Closed wuhanstudio closed 2 years ago
@wuhanstudio I can't reproduce on the latest main of TorchVision. Could you please check?
Hi, @datumbox,
Thanks for your kindly help.
I just installed both torch
and torchvision
from source. Indeed, this issue has been resolved in the main
branch by:
But I notice that this is resolved by a workaround for another onnx issue. If the following line is restored in the future when it is supported by onnx, the issue of gradient retrieval may reappear.
# pad_img[: img.shape[0], : img.shape[1], : img.shape[2]].copy_(img)
Thanks.
We plan to refactor this code on the near future, so we can resolve it there. I'm going to close the issue as I believe the matter is resolved, nevertheless if you still have concerns feel free to reopen. Thanks!
🐛 Describe the bug
Hi, Recently, I use pretrained models from torchvision for my research, but I'm unable to get gradients from pretrained models due to inplace modification
copy_
Code to reproduce the error:
Error traceback in torchvision v0.10.1+cpu:
Error traceback in torchvision v0.11.2+cpu
Versions
PyTorch version: 1.10.1+cpu Is debug build: False CUDA used to build PyTorch: None ROCM used to build PyTorch: N/A
OS: Microsoft Windows 10 Pro GCC version: Could not collect Clang version: Could not collect CMake version: Could not collect Libc version: N/A
Python version: 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] (64-bit runtime) Python platform: Windows-10-10.0.19041-SP0 Is CUDA available: False CUDA runtime version: No CUDA GPU models and configuration: No CUDA Nvidia driver version: No CUDA cuDNN version: No CUDA HIP runtime version: N/A MIOpen runtime version: N/A
Versions of relevant libraries: [pip3] mypy==0.790 [pip3] mypy-extensions==0.4.3 [pip3] numpy==1.18.4 [pip3] numpy-ml==0.1.2 [pip3] torch==1.10.1 [pip3] torchaudio==0.9.1 [pip3] torchfile==0.1.0 [pip3] torchnet==0.0.4 [pip3] torchvision==0.11.2 [conda] Could not collect
cc @datumbox