Skip to content
New issue

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

conduct experiment #2

Open
magus96 opened this issue Apr 4, 2019 · 2 comments
Open

conduct experiment #2

magus96 opened this issue Apr 4, 2019 · 2 comments

Comments

@magus96
Copy link

magus96 commented Apr 4, 2019

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]

@msurtsukov
Copy link
Owner

On my machine notebook runs end-to-end both with and without cuda. Pytorch version - 1.0.0.

@magus96
Copy link
Author

magus96 commented Apr 4, 2019

My issue is that [1,354] and [354] are the same vector shapes and Pytorch should automatically detect that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants