我正在尝试使用使用 torch 的脚本,但我不断收到此属性错误:
AttributeError: partially initialized module 'torch' has no attribute 'Tensor' (most likely due to a circular import)
我尝试过跑步
pip3 uninstall torch
pip3 uninstall torchvision
pip3 uninstall torchaudio
pip3 install torch
pip3 install torchvision
pip3 install torchaudio
但这对我不起作用。有人知道我该如何解决这个问题吗?任何帮助将不胜感激!
您尝试运行的脚本很可能与 torch 或它导入的东西想要导入的模块命名相同。尝试重命名您的脚本。