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

简介: 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


目录
相关文章
|
9月前
|
PyTorch 算法框架/工具 Python
AttributeError: module ‘distutils‘ has no attribute ‘version‘解决跑pytorch代码报错
AttributeError: module ‘distutils‘ has no attribute ‘version‘解决跑pytorch代码报错
AttributeError: module ‘torch.utils‘ has no attribute ‘data‘
属性错误:模块的'torch.utils'没有属性'data'
70 0
|
PyTorch 算法框架/工具
torch中报错:AttributeError: 'builtin_function_or_method' object has no attribute 'detach'怎么解决?
这个错误信息 "AttributeError: 'builtin_function_or_method' object has no attribute 'detach'" 表示你尝试在一个内置函数或方法对象上调用 detach() 方法,而这种对象没有这个属性。 detach() 是 PyTorch 张量和变量的方法,允许它们从计算图中分离出来,因此不能在其他类型的对象上调用。要解决这个错误,请确保你正在一个 PyTorch 张量或变量上调用 detach() 方法。
862 0
|
TensorFlow API 算法框架/工具
解决AttributeError: module ‘tensorflow‘ has no attribute ‘div‘
解决AttributeError: module ‘tensorflow‘ has no attribute ‘div‘
142 0
解决AttributeError: module ‘tensorflow‘ has no attribute ‘div‘
TensorRT:AttributeError: 'module' object has no attribute 'Logger'
TensorRT:AttributeError: 'module' object has no attribute 'Logger'
175 0
|
PyTorch 算法框架/工具
问题解决:AttributeError: 'module' object has no attribute '_rebuild_tensor_v2'
问题解决:AttributeError: 'module' object has no attribute '_rebuild_tensor_v2'
240 0
|
TensorFlow 算法框架/工具
成功解决AttributeError: module ‘tensorflow‘ has no attribute ‘get_variable‘
成功解决AttributeError: module ‘tensorflow‘ has no attribute ‘get_variable‘
|
TensorFlow 算法框架/工具
TF版本升级问题:成功解决AttributeError: module tensorflow has no attribute mul
TF版本升级问题:成功解决AttributeError: module tensorflow has no attribute mul
TF版本升级问题:成功解决AttributeError: module tensorflow has no attribute mul
|
TensorFlow 算法框架/工具
成功解决AttributeError: module tensorflow has no attribute lite
成功解决AttributeError: module tensorflow has no attribute lite