PyTorch-CycleGAN icon indicating copy to clipboard operation
PyTorch-CycleGAN copied to clipboard

UserWarning: Argument interpolation should be of type InterpolationMode instead of int. Please, use InterpolationMode enum.

Open JimberZ opened this issue 3 years ago • 8 comments

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!

JimberZ avatar Mar 14 '21 03:03 JimberZ

Guess this problem is caused by Pillow 7.0: https://github.com/pytorch/vision/issues/1846 Does change the Pillow version help?

Mukosame avatar May 24 '21 22:05 Mukosame

@Mukosame I have the same issue. Going to Pillow 6.2.1 did not help as referenced in that link.

trigaten avatar Jul 13 '21 14:07 trigaten

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.

Keiku avatar Jul 28 '21 09:07 Keiku

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).

askerlee avatar Aug 08 '21 14:08 askerlee

I solved it by using T.InterpolationMode.BICUBIC instead of Image.BICUBIC in my project.

T.Resize((224, 224), T.InterpolationMode.BICUBIC)

can you let me know what T is in your code?

akshat-kulsh avatar May 19 '22 06:05 akshat-kulsh

@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

Keiku avatar May 19 '22 06:05 Keiku

I believe you can also omit the InterpolationMode, and just have the T.Resize((224, 224)) It will automatically use the InterpolationMode.BILINEAR

ShirazSevadjian avatar Jun 07 '22 05:06 ShirazSevadjian

@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.

StatsGary avatar Aug 10 '22 10:08 StatsGary