Open suyanzhou626 opened 5 years ago
Please
return (x,)
@suyanzhou626 do you solve this problem?
@leezonpen @suyanzhou626 in your model code, write as : class Model(XXX): def forward(self,XXX): //XXXX your net code x = layer(x) return (x,) // instead of "return x"
@artzers it don't work for me. I gather the output and slice it for multi-task loss (scatter before input to the criterion). It seem like that some problem apeared in the DataParallelCriterion. How can i solve it?
I can run it for simple mission such as super resolution or segment. I haven't test multi-task loss mission. I'll try later, or you can continue to contact with @zhanghang1989
When I use DataParallelModel and DataParallelCriterion, Wrong Occur, like ` Traceback (most recent call last): File "train_SyncBN.py", line 151, in
loss = criterion(outputs, labels)
File "/home/phd-1/.conda/envs/pytorch-0.41/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, *kwargs)
File "/home/phd-1/.conda/envs/pytorch-0.41/lib/python3.6/site-packages/encoding/parallel.py", line 134, in forward
outputs = _criterion_parallel_apply(replicas, inputs, targets, kwargs)
File "/home/phd-1/.conda/envs/pytorch-0.41/lib/python3.6/site-packages/encoding/parallel.py", line 188, in _criterion_parallel_apply
raise output
File "/home/phd-1/.conda/envs/pytorch-0.41/lib/python3.6/site-packages/encoding/parallel.py", line 163, in _worker
output = module((input + target), **kwargs)
TypeError: add() received an invalid combination of arguments - got (tuple), but expected one of: