-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead. #44023
Comments
The error is pretty self-explanatory. You can't call If this doesn't work, please open an issue in the PytorchLightning repo. |
@fe1w0 Yes, modifying the source is not the best solution. Can you please provide the minimal reproducible example? I'm not even sure this issue is still relevant as I can't find the relevant code in the PyTorchLightning source. Which version of PyTorchLightning are you using? |
I'm very sorry😵💫, but I haven't responded to the message until now. I think this is not a pytorch problem, it should be related to my tenserflow environment. When I reconfigure tenserflow, after This is the reference link for my reinstallation, suitable for apple m1 |
This appears to be an issue with PyTorch Lightning (and possibly only an older version of it). So closing it here. You might want to open an issue at the PyTorch Lightning Github (https://github.com/PyTorchLightning/pytorch-lightning), @curehabit. |
When I run this:
I got this error:
I believe this error is related to the source code and changing the tensor source code is not the best solution. Any recommendations on what to do? |
It looks like you're calling NumPy's |
🐛 Bug
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Environment
Environment
CUDA:
Packages:
System:
PyTorch Version (e.g., 1.0): 1.6
OS (e.g., Linux): Linux
How you installed PyTorch (conda, pip, source): pip
Build command you used (if compiling from source):
Python version: 3.7.8
CUDA/cuDNN version: None
GPU models and configuration: None
Any other relevant information: torch_xla:1.6.0
Additional context
cc @brianjo @mruberry @jlin27
The text was updated successfully, but these errors were encountered: