Skip to content

多卡训练bug #45

Open
Open
@wade0604

Description

@wade0604

hi,i used the training scripts as follows:

NNODES=${NNODES:-1}
NODE_RANK=${NODE_RANK:-0}
PORT=${PORT:-29500}
MASTER_ADDR=${MASTER_ADDR:-"127.0.0.1"}
export RANK=${NODE_RANK}
export WORLD_SIZE=8
export MASTER_ADDR=${MASTER_ADDR}
export MASTER_PORT=${PORT}
echo "MASTER_ADDR: ${MASTER_ADDR}"
echo "MASTER_PORT: ${MASTER_PORT}"
echo "NODE_RANK: ${NODE_RANK}"
python3 -m torch.distributed.launch
--nnodes=${NNODES}
--node_rank=${NODE_RANK}
--master_addr=${MASTER_ADDR}
--nproc_per_node=${WORLD_SIZE}
--master_port=${MASTER_PORT}
led/train.py
-opt /mnt/bn/zjw-yg/LED/options/LED/pretrain/MM22_PMN_Setting.yaml
--launcher pytorch

but the code reported an error:

RuntimeError: Expected to have finished reduction in the prior iteration before starting a new one. This error indicates that your module has parameters that were not used in producing loss. You can enable unused parameter detection by passing the keyword argument find_unused_parameters=True to torch.nn.parallel.DistributedDataParallel, and by
making sure all forward function outputs participate in calculating loss.
If you already have done the above, then the distributed data parallel module wasn't able to locate the output tensors in the return value of your module's forward function. Please include the loss function and the structure of the return value of forward of your module when reporting this issue (e.g. list, dict, iterable).
Parameter indices which did not receive grad for rank 1: 2 3 4 5 6 7 8 9 10 11 14 15 16 17 18 19 20 21 22 23 26 27 28 29 30 31 32 33 34 35 38 39 40 41 42 43 44 45 46 47 50 51 52 53 54 55 56 57 58 59 62 63 64 65 66 67 68 69 70 71 74 75 76 77 78 79 80 81 82 83 86 87 88 89 90 91 92 93 94 95 98 99 100 101 102 103 104 105 106 107 110 111 112 113 114 115 116 117 118 119 ..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions