aitorzip / PyTorch-CycleGAN

A clean and readable Pytorch implementation of CycleGAN
https://arxiv.org/abs/1703.10593
GNU General Public License v3.0
1.19k stars 283 forks source link

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

Open JimberZ opened 3 years ago

JimberZ commented 3 years ago

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!

Mukosame commented 3 years ago

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

trigaten commented 2 years ago

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

Keiku commented 2 years ago

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.

askerlee commented 2 years ago

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

akshat-kulsh commented 2 years ago

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?

Keiku commented 2 years ago

@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
ShirazSevadjian commented 2 years ago

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

StatsGary commented 1 year ago

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