Fixed-Point-GAN
Fixed-Point-GAN copied to clipboard
AttributeError: 'module' object has no attribute 'Resize'
Hello, and thank you for sharing this amazing project on GitHub.
However, I meet an issue when executing the code.
The step that the issue occurs and its concrete information are as shown in the figure.
I don't know what goes wrong because I just start to learn coding to finish my dissertation. It would be great if someone could help me get through this :)
Hi. I appreciate your interest. The problem seems to be with the installation of torchvision.
Thanks for the advice, which gives me inspiration to solve the problem within these five days ( 'solve' means there is no error reported anymore and executing the code start to return [Elapse] and [Iteration] , etc , which seem to be the info of training process ). And I would like to share the whole solving process in case someone might need it in the future.
I run the code on a VMware Linux virtual machine. the OS is Ubuntu-22.10-desktop-amd64.
Error 1: After following the instruction of creating the environment, when executing code of training CelebA dataset:
Solution for Error 1: I found the source document of torchvision.transforms() in /anaconda3/envs/pytorch0.2/lib/python2.7/site-packages/torchvision-0.1.9-py2.7.egg/ and copy & paste the 'Resize' part from another higher version of torchvision into the transforms.py
Error 2: After executing solution for Error 1 and the training code again:
Solution for Error 2:
As shown above, I installed the latest version of Torch.
Error 3: After executing solution for Error 2 and the training code again:
Solution for Error 3: execute 'pip install future' to install the missing module.
Error 4: After executing solution for Error 3 and the training code again:
Solution for Error 4:
Error 5: After executing solution for Error 4 and the training code again:
Solution for Error 5: I found the definition of F in transforms.py of the higher Ver. torchvision from which I copied & pasted the .py to older Ver. And added the same thing into current transforms.py
Shown as below:
Error 6: After executing solution for Error 5 and the training code again:
Solution for Error 6: Problem lies in the 'import' sentence I just added. So I got back to the source document of higher Ver. torchvision, and copied & pasted its functional.py to current torchvision's source document.
Error 7: After executing solution for Error 6 and the training code again:
Solution for Error 7: Execute 'pip install torchvision' to update torchvision.
At last, I ran the training code without error :)