We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting the following error.
RuntimeError Traceback (most recent call last) in () ----> 1 conduct_experiment(ode_true, ode_trained, 500, "linear")
in conduct_experiment(ode_true, ode_trained, n_steps, name, plot_freq) 38 39 optimizer.zero_grad() ---> 40 loss.backward(retain_graph=True) 41 optimizer.step() 42
/usr/local/lib/python3.6/dist-packages/torch/tensor.py in backward(self, gradient, retain_graph, create_graph) 91 products. Defaults to False. 92 """ ---> 93 torch.autograd.backward(self, gradient, retain_graph, create_graph) 94 95 def register_hook(self, hook):
False
/usr/local/lib/python3.6/dist-packages/torch/autograd/init.py in backward(tensors, grad_tensors, retain_graph, create_graph, grad_variables) 88 Variable._execution_engine.run_backward( 89 tensors, grad_tensors, retain_graph, create_graph, ---> 90 allow_unreachable=True) # allow_unreachable flag 91 92
RuntimeError: Function ODEAdjointBackward returned an invalid gradient at index 2 - expected shape [4] but got [1, 4]
The text was updated successfully, but these errors were encountered:
On my machine notebook runs end-to-end both with and without cuda. Pytorch version - 1.0.0.
Sorry, something went wrong.
My issue is that [1,354] and [354] are the same vector shapes and Pytorch should automatically detect that.
No branches or pull requests
Getting the following error.
RuntimeError Traceback (most recent call last)
in ()
----> 1 conduct_experiment(ode_true, ode_trained, 500, "linear")
in conduct_experiment(ode_true, ode_trained, n_steps, name, plot_freq)
38
39 optimizer.zero_grad()
---> 40 loss.backward(retain_graph=True)
41 optimizer.step()
42
/usr/local/lib/python3.6/dist-packages/torch/tensor.py in backward(self, gradient, retain_graph, create_graph)
91 products. Defaults to
False
.92 """
---> 93 torch.autograd.backward(self, gradient, retain_graph, create_graph)
94
95 def register_hook(self, hook):
/usr/local/lib/python3.6/dist-packages/torch/autograd/init.py in backward(tensors, grad_tensors, retain_graph, create_graph, grad_variables)
88 Variable._execution_engine.run_backward(
89 tensors, grad_tensors, retain_graph, create_graph,
---> 90 allow_unreachable=True) # allow_unreachable flag
91
92
RuntimeError: Function ODEAdjointBackward returned an invalid gradient at index 2 - expected shape [4] but got [1, 4]
The text was updated successfully, but these errors were encountered: