Hi,
Can you please check this?
Traceback (most recent call last):
File "./pytorch_run.py", line 153, in
train()
File "./pytorch_run.py", line 93, in train
loss.backward() # backprop
File "/usr/local/lib/python2.7/dist-packages/torch/autograd/variable.py", line 167, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph, retain_variables)
File "/usr/local/lib/python2.7/dist-packages/torch/autograd/init.py", line 99, in backward
variables, grad_variables, retain_graph)
RuntimeError: size is not implemented for type UndefinedType
The error is in the register parameter in pytorch_model.py
Removing them the model works fine.
What was the function of register parameter? Thanks.
Hi @DeepInEvil i am also getting an Error
File "pytorch_run.py", line 162, in
train()
File "pytorch_run.py", line 101, in train
loss.backward() # backprop
File "/data/home/adeshadikane/ML/rcs/lib/python3.8/site-packages/torch/_tensor.py", line 487, in backward
torch.autograd.backward(
File "/data/home/adeshadikane/ML/rcs/lib/python3.8/site-packages/torch/autograd/init.py", line 200, in backward
Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
RuntimeError: Function NativeBatchNormBackward0 returned an invalid gradient at index 2 - got [0] but expected shape compatible with [1995]
Could you please help me with it or can you send me the corrected code which is working.