-
Notifications
You must be signed in to change notification settings - Fork 87
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 #42
Comments
Came here to post this because I just got the error on Colab: ----> 3 backprop.visualize(img, target_class, guided=True, use_gpu=True)
1 frames
/usr/local/lib/python3.7/dist-packages/flashtorch/saliency/backprop.py in visualize(self, input_, target_class, guided, use_gpu, figsize, cmap, alpha, return_output)
180 # (title, [(image1, cmap, alpha), (image2, cmap, alpha)])
181 ('Input image',
--> 182 [(format_for_plotting(denormalize(input_)), None, None)]),
183 ('Gradients across RGB channels',
184 [(format_for_plotting(standardize_and_clip(gradients)),
/usr/local/lib/python3.7/dist-packages/flashtorch/utils/__init__.py in denormalize(tensor)
117
118 for channel, mean, std in zip(denormalized[0], means, stds):
--> 119 channel.mul_(std).add_(mean)
120
121 return denormalized
RuntimeError: Output 0 of UnbindBackward is a view and is being modified inplace. This view is the output of a function that returns multiple views. Such functions do not allow the output views to be modified inplace. You should replace the inplace operation by an out-of-place one. @MisaOgura: Any idea what's going wrong here? I see a related closed issue in torchvision that suggests wrapping in EDIT: seems the breaking change happened in pytorch 1.7, and affected many other packages. But haven't found another package that had this issue and was trying to visualize gradients. |
@MisaOgura Is There any update version for this problem? or any suggest workround? I also facing this issue, when using pytorch1.8.1 with gpu cuda111 and also tried without the gpu, but still no luck thanks |
RuntimeError Traceback (most recent call last)
in
9 # Ready to roll!
10
---> 11 backprop.visualize(owl, target_class, guided=True)
~\Downloads\flashtorch-master\flashtorch\saliency\backprop.py in visualize(self, input_, target_class, guided, use_gpu, figsize, cmap, alpha, return_output)
180 # (title, [(image1, cmap, alpha), (image2, cmap, alpha)])
181 ('Input image',
--> 182 [(format_for_plotting(denormalize(input_)), None, None)]),
183 ('Gradients across RGB channels',
184 [(format_for_plotting(standardize_and_clip(gradients)),
~\Downloads\flashtorch-master\flashtorch\utils_init_.py in denormalize(tensor)
117
118 for channel, mean, std in zip(denormalized[0], means, stds):
--> 119 channel.mul_(std).add_(mean)
120
121 return denormalized
RuntimeError: Output 0 of UnbindBackward is a view and is being modified inplace. This view is the output of a function that returns multiple views. Such functions do not allow the output views to be modified inplace. You should replace the inplace operation by an out-of-place one.
The text was updated successfully, but these errors were encountered: