When updating PyTorch to the current latest 1.8.1 and torchvision to the corresponding 0.9.1 calling torchmeta.transforms.Rotation causes the warning:
~/.cache/pypoetry/virtualenvs/retrainer-TPV0pAOM-py3.8/lib/python3.8/site-packages/torchvision/transforms/functional.py:942: UserWarning: Argument interpolation should be of type InterpolationMode instead of int. Please, use InterpolationMode enum.
Complete steps to reproduce the bug
Use transforms with Torchvision 0.9.1 that interpolate an image.
Expected behavior
No warnings, preferably by the ability to pass **kwargs through.
Environment
OS: Ubuntu 20.04
Library Version 0.1.0
Additional context
Pulling a full stack trace of the warning got me the exact method:
File "~/.cache/pypoetry/virtualenvs/retrainer-TPV0pAOM-py3.8/lib/python3.8/site-packages/torchmeta/transforms/augmentations.py", line 34, in __call__
return F.rotate(image, self.angle % 360, self.resample,
It seems this is the new API. Easy fix is to pass generic **kwargs instead of specific ones which I have already tested, although this be needed for other transforms also. This would be a change more robust to future API changes and flexible for users also I think. I have been using this library a lot for some time now, so let me know if you would be interested in a PR for this.
When updating PyTorch to the current latest
1.8.1
and torchvision to the corresponding0.9.1
callingtorchmeta.transforms.Rotation
causes the warning:Complete steps to reproduce the bug
Use transforms with Torchvision
0.9.1
that interpolate an image.Expected behavior
No warnings, preferably by the ability to pass
**kwargs
through.Environment
Additional context
Pulling a full stack trace of the warning got me the exact method:
It seems this is the new API. Easy fix is to pass generic
**kwargs
instead of specific ones which I have already tested, although this be needed for other transforms also. This would be a change more robust to future API changes and flexible for users also I think. I have been using this library a lot for some time now, so let me know if you would be interested in a PR for this.Copied from: https://github.com/tristandeleu/pytorch-meta/issues/131