raise error
huixiancheng opened this issue · 1 comments
Like this
File "/cloud/seg/modules/trainer2.py", line 426, in train_epoch loss_m.backward() File "/environment/python/versions/miniconda3-4.7.12/lib/python3.7/site-packages/torch/tensor.py", line 245, in backward torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs) File "/environment/python/versions/miniconda3-4.7.12/lib/python3.7/site-packages/torch/autograd/__init__.py", line 147, in backward allow_unreachable=True, accumulate_grad=True) # allow_unreachable flag File "/environment/python/versions/miniconda3-4.7.12/lib/python3.7/site-packages/torch/autograd/function.py", line 89, in apply return self._forward_cls.backward(self, *args) # type: ignore File "/cloud/seg/modules/inovo.py", line 245, in backward assert grad_output.is_cuda and grad_output.is_contiguous() AssertionError
try to solve by
if not grad_output.is_contiguous():
grad_output = grad_output.contiguous()
assert grad_output.is_cuda and grad_output.is_contiguous()
Not sure if it will cause exception