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

5_Deep_Q_Network中RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead. #3

Open
NikoHsu opened this issue Aug 25, 2022 · 3 comments

Comments

@NikoHsu
Copy link

NikoHsu commented Aug 25, 2022

RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.增加了detach()也一样报错,输出loss图异常

@NikoHsu NikoHsu changed the title RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead. 5_Deep_Q_Network中RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead. Aug 25, 2022
@NikoHsu
Copy link
Author

NikoHsu commented Sep 5, 2022

在loss反向传播后需要detach()一下才能继续画图

@usernameuiui
Copy link

感谢大佬

@ClownW
Copy link
Owner

ClownW commented Nov 7, 2022 via email

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

3 participants