jiangyzy / GOAE

[ICCV 2023] Official implementation of "Make Encoder Great Again in 3D GAN Inversion through Geometry and Occlusion-Aware Encoding" in International Conference on Computer Vision (ICCV) 2023.
85 stars 8 forks source link

module 'torch' has no attribute 'no_grad' #19

Closed 29995270 closed 6 months ago

29995270 commented 6 months ago

raise error when python infer.py --multi_view --video

Traceback (most recent call last): File "infer.py", line 6, in <module> import torchvision File "/data/miniconda3/envs/goae/lib/python3.8/site-packages/torchvision/__init__.py", line 5, in <module> from torchvision import datasets File "/data/miniconda3/envs/goae/lib/python3.8/site-packages/torchvision/datasets/__init__.py", line 1, in <module> from ._optical_flow import KittiFlow, Sintel, FlyingChairs, FlyingThings3D, HD1K File "/data/miniconda3/envs/goae/lib/python3.8/site-packages/torchvision/datasets/_optical_flow.py", line 12, in <module> from ..io.image import _read_png_16 File "/data/miniconda3/envs/goae/lib/python3.8/site-packages/torchvision/io/__init__.py", line 5, in <module> from ..utils import _log_api_usage_once File "/data/miniconda3/envs/goae/lib/python3.8/site-packages/torchvision/utils.py", line 21, in <module> @torch.no_grad() AttributeError: module 'torch' has no attribute 'no_grad'

this is my pip list result ` Package Version


absl-py 2.1.0 astunparse 1.6.3 cachetools 4.2.4 certifi 2024.2.2 charset-normalizer 3.3.2 click 8.1.7 dominate 2.9.1 filelock 3.13.4 fsspec 2024.3.1 gast 0.3.3 google-auth 1.35.0 google-auth-oauthlib 0.4.6 google-pasta 0.2.0 grpcio 1.62.2 h5py 2.10.0 huggingface-hub 0.22.2 idna 3.7 imageio 2.9.0 imageio-ffmpeg 0.4.9 importlib_metadata 7.1.0 keras 2.15.0 Keras-Preprocessing 1.1.2 kornia 0.7.2 kornia_rs 0.1.3 Markdown 3.6 MarkupSafe 2.1.5 mrcfile 1.5.0 mtcnn 0.1.1 networkx 3.1 ninja 1.10.2 numpy 1.18.5 oauthlib 3.2.2 opencv-python 4.9.0.80 opt-einsum 3.3.0 packaging 24.0 pillow 10.3.0 pip 23.3.1 protobuf 3.20.3 psutil 5.9.8 pyasn1 0.6.0 pyasn1_modules 0.4.0 pyspng 0.1.1 PyWavelets 1.4.1 PyYAML 6.0.1 requests 2.31.0 requests-oauthlib 2.0.0 rsa 4.9 safetensors 0.4.3 scikit-image 0.19.3 scipy 1.9.3 setuptools 68.2.2 six 1.16.0 tensorboard 2.2.2 tensorboard-plugin-wit 1.8.1 tensorboardX 2.5 tensorflow 2.2.1 tensorflow-estimator 2.2.0 termcolor 2.4.0 tifffile 2023.7.10 timm 0.9.16 torch 1.11.0 torchvision 0.12.0 tqdm 4.66.2 trimesh 4.2.0 typing_extensions 4.11.0 urllib3 2.2.1 Werkzeug 3.0.2 wheel 0.41.2 wrapt 1.16.0 yacs 0.1.8 zipp 3.18.1 `

jiangyzy commented 6 months ago

Please try to reinstall the torch following official commands