PyTorch-CycleGAN
PyTorch-CycleGAN copied to clipboard
UserWarning: Argument interpolation should be of type InterpolationMode instead of int. Please, use InterpolationMode enum.
Setting up a new session... Namespace(batchSize=1, cuda=True, dataroot='C:\Users\MaYu\Desktop\Dachuang\datasets\horse2zebra', decay_epoch=100, epoch=0, input_nc=3, lr=0.0002, n_cpu=6, n_epochs=200, output_nc=3, size=256) E:\anaconda\anaconda\envs\pytorch\lib\site-packages\torchvision\transforms\transforms.py:257: UserWarning: Argument interpolation should be of type InterpolationMode instead of int. Please, use InterpolationMode enum. warnings.warn(
help me plz!
Guess this problem is caused by Pillow 7.0: https://github.com/pytorch/vision/issues/1846 Does change the Pillow version help?
@Mukosame I have the same issue. Going to Pillow 6.2.1 did not help as referenced in that link.
I solved it by using T.InterpolationMode.BICUBIC
instead of Image.BICUBIC
in my project.
T.Resize((224, 224), T.InterpolationMode.BICUBIC)
Note that in my project, not in PyTorch-CycleGAN.
One thing to note is that T.InterpolationMode.* seem to be equal to Image.*. So we may ignore this warning safely (at least for now).
I solved it by using
T.InterpolationMode.BICUBIC
instead ofImage.BICUBIC
in my project.T.Resize((224, 224), T.InterpolationMode.BICUBIC)
can you let me know what T is in your code?
@akshat-kulsh It's a long time ago, so I can't remember, but it's probably code like this:
import torchvision.transforms as T
I believe you can also omit the InterpolationMode, and just have the
T.Resize((224, 224))
It will automatically use the InterpolationMode.BILINEAR
@akshat-kulsh It's a long time ago, so I can't remember, but it's probably code like this:
import torchvision.transforms as T
Yes, excellent - that worked for me.