本文主要是介绍cannot import name ‘int_classes‘ from ‘torch._six‘亲测有效,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
问题报错描述
D:\Anaconda3\envs\yolo5\python.exe C:\Users\aw\Desktop\yolov5-alphapose-stgcn\main_ui.py
Traceback (most recent call last):File "C:\Users\aw\Desktop\yolov5-alphapose-stgcn\main_ui.py", line 3, in <module>from UI.MainWindows import MainWinddowFile "C:\Users\aw\Desktop\yolov5-alphapose-stgcn\UI\MainWindows.py", line 10, in <module>from video_process import videoprocessFile "C:\Users\aw\Desktop\yolov5-alphapose-stgcn\video_process.py", line 15, in <module>from fn import draw_singleFile "C:\Users\aw\Desktop\yolov5-alphapose-stgcn\fn.py", line 13, in <module>from torch._six import string_classes, int_classes
ImportError: cannot import name 'int_classes' from 'torch._six' (D:\Anaconda3\envs\yolo5\lib\site-packages\torch\_six.py)
解决方案,点击报错的的链接,跳转到fn.py
然后找到【from torch._six import string_classes, int_classes】
把它替换为,也就是替换成下面的两个导入语句,重新运行代码即可解决,如果有用,点个赞呗
from torch._six import string_classes
import collections.abc as int_classes
这篇关于cannot import name ‘int_classes‘ from ‘torch._six‘亲测有效的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!