Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JimberZ opened this issue Mar 14, 2021 · 8 comments

Comments

@JimberZ
Copy link

JimberZ commented Mar 14, 2021

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
Copy link

Guess this problem is caused by Pillow 7.0: pytorch/vision#1846
Does change the Pillow version help?

@trigaten
Copy link

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

@Keiku
Copy link

Keiku commented Jul 28, 2021

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
Copy link

askerlee commented Aug 8, 2021

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
Copy link

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
Copy link

Keiku commented May 19, 2022

@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
Copy link

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

@StatsGary
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants