pytorch-CycleGAN-and-pix2pix
pytorch-CycleGAN-and-pix2pix copied to clipboard
AttributeError: module 'torchvision.transforms' has no attribute 'InterpolationMode'
System: Windows and Ubuntu
using Anaconda set up environment base on the environment.yml
.
run CycleGAN train/test
Traceback (most recent call last):
File "D:/PycharmProjects/pytorch-CycleGAN-and-pix2pix/test.py", line 30, in <module>
from options.test_options import TestOptions
File "D:\PycharmProjects\pytorch-CycleGAN-and-pix2pix\options\test_options.py", line 1, in <module>
from .base_options import BaseOptions
File "D:\PycharmProjects\pytorch-CycleGAN-and-pix2pix\options\base_options.py", line 6, in <module>
import data
File "D:\PycharmProjects\pytorch-CycleGAN-and-pix2pix\data\__init__.py", line 15, in <module>
from data.base_dataset import BaseDataset
File "D:\PycharmProjects\pytorch-CycleGAN-and-pix2pix\data\base_dataset.py", line 81, in <module>
def get_transform(opt, params=None, grayscale=False, method=transforms.InterpolationMode.BICUBIC, convert=True):
AttributeError: module 'torchvision.transforms' has no attribute 'InterpolationMode'
I saw in commit 9bcef69d5b39385d18afad3d5a839a02ae0b43e7, it uses Image.BICUBIC
but not transforms.InterpolationMode.BICUBIC
.
So I just change the code back to Image.BICBIC
, and it works.
I believe you forget to update the environment.yml
I saw in commit 9bcef69, it uses
Image.BICUBIC
but nottransforms.InterpolationMode.BICUBIC
. So I just change the code back toImage.BICBIC
, and it works. I believe you forget to update theenvironment.yml
thanks
It really helps, thks
help!
Guys, just update you torchvision
I faced with this error when I trained cycleGAN on TPU.
Please use a more recent torchvision.
thank you!