Win x64、Spyder、Python 3.9、Pytorch 2.0.1+cu117
大量的
C:\Users\sengnr3\.conda\envs\pytorch\Lib\site-packages\torchvision\transforms\v2\__init__.py:54: UserWarning: The torchvision.datapoints and torchvision.transforms.v2 namespaces are still Beta.
While we do not expect major breaking changes, some APIs may still change according to user feedback. Please submit any feedback you may have in this issue:
https://github.com/pytorch/vision/issues/6753, and you can also check out https://github.com/pytorch/vision/issues/7319 to learn more about the APIs that we suspect might involve future changes.
You can silence this warning by calling torchvision.disable_beta_transforms_warning().
warnings.warn(_BETA_TRANSFORMS_WARNING)
字符串
所以我试着用警告代码中的建议保持沉默,
import torchvision
torchvision.disable_beta_transforms_warning()
型
但仍然是同样的警告。
1条答案
按热度按时间n3schb8v1#
它看起来像禁用v2警告你需要先调用
disable_beta_transforms_warning()
然后导入v2
转换。例如,以下代码不会禁用警告:
字符串
但这段代码做到了:
型
如果你先导入
v2
transform,它会发出警告,因为python先导入v2
transform而没有禁用警告。