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

RuntimeError: set_storage_offset is not allowed on a Tensor created from .data or .detach(). #11

Open
bixiwen opened this issue Jun 11, 2020 · 2 comments

Comments

@bixiwen
Copy link

bixiwen commented Jun 11, 2020

Hi,when I run selfdeblur_levin.py,I have the error:
im1_kernel1_img
Traceback (most recent call last):
File "selfdeblur_levin.py", line 101, in
net_input_kernel.squeeze_()
RuntimeError: set_storage_offset is not allowed on a Tensor created from .data or .detach().
If your intent is to change the metadata of a Tensor (such as sizes / strides / storage / storage_offset)
without autograd tracking the change, remove the .data / .detach() call and wrap the change in a with torch.no_grad(): block.
For example, change:
x.data.set_(y)
to:
with torch.no_grad():
x.set_(y)

@csdwren
Copy link
Owner

csdwren commented Jun 11, 2020

I think you are using higher version Pytorch. You can try to delete “.detach()” in variables "net_input" and "net_input_kernel"

@bixiwen bixiwen closed this as completed Jun 11, 2020
@bixiwen bixiwen reopened this Jun 11, 2020
@bixiwen
Copy link
Author

bixiwen commented Jun 11, 2020

I think you are using higher version Pytorch. You can try to delete “.detach()” in variables "net_input" and "net_input_kernel"

Thank you so much!

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