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

compatible with torch 1.5.0 #37

Closed
Trinkle23897 opened this issue Apr 23, 2020 · 0 comments
Closed

compatible with torch 1.5.0 #37

Trinkle23897 opened this issue Apr 23, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Trinkle23897
Copy link
Collaborator

Trinkle23897 commented Apr 23, 2020

Fail in SACPolicy with torch==1.5.0

Traceback (most recent call last):
  File "test/continuous/test_sac_with_il.py", line 145, in <module>
    test_sac_with_il()
  File "test/continuous/test_sac_with_il.py", line 106, in test_sac_with_il
    args.batch_size, stop_fn=stop_fn, save_fn=save_fn, writer=writer)
  File "/home/trinkle/github/tianshou-new/tianshou/trainer/offpolicy.py", line 87, in offpolicy_trainer
    losses = policy.learn(train_collector.sample(batch_size))
  File "/home/trinkle/github/tianshou-new/tianshou/policy/modelfree/sac.py", line 131, in learn
    actor_loss.backward()
  File "/home/trinkle/.local/lib/python3.6/site-packages/torch/tensor.py", line 198, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph)
  File "/home/trinkle/.local/lib/python3.6/site-packages/torch/autograd/__init__.py", line 100, in backward
    allow_unreachable=True)  # allow_unreachable flag
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [128, 1]], which is output 0 of TBackward, is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).
@Trinkle23897 Trinkle23897 added the bug Something isn't working label Apr 23, 2020
@Trinkle23897 Trinkle23897 self-assigned this Apr 23, 2020
BFAnas pushed a commit to BFAnas/tianshou that referenced this issue May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

No branches or pull requests

1 participant