AttributeError: module ‘torch.jit‘ has no attribute ‘_script_if_tracing‘

项目场景:

torvh使用提示

AttributeError: module 'torch.jit' has no attribute '_script_if_tracing'

原因分析:

解决办法:原因是torch与torchvision版本不匹配导致的,重新安装torchvision即可


解决方案:

pip install torchvision==0.5.0

猜你喜欢

转载自blog.csdn.net/qq_39237205/article/details/127150131