0
点赞
收藏
分享

微信扫一扫

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

ITWYY 2022-03-11 阅读 136

问题描述

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

解决办法

第一步: 导入from torchvision.transforms import InterpolationMode
第二步:将Image替换成InterpolationMode
例如:

import torchvision.transforms.functional as F
F.resize(img, target_size, Image.BILINEAR), 
F.resize(img, target_size, Image.NEAREST)

改为:

import torchvision.transforms.functional as F
F.resize(img, target_size, InterpolationMode.BILINEAR), 
F.resize(img, target_size, InterpolationMode.NEAREST)

参考:https://blog.csdn.net/u014636245/article/details/118104938

举报

相关推荐

0 条评论