WZMIAOMIAO / deep-learning-for-image-processing

deep learning for image processing including classification and object-detection etc.
GNU General Public License v3.0
23.33k stars 8.02k forks source link

高版本的torch报错未发现torch._six #747

Open water107 opened 1 year ago

water107 commented 1 year ago

System information

我的torch版本是2.0.1

mjc-ddj commented 1 year ago

我也遇到了同样的问题,请问你解决了吗

mjc-ddj commented 1 year ago

import torch._six我直接将这一段注释掉了,debug并没有报错

linwqwhu commented 1 year ago

有两种方式

# 把import语句注释掉,并添加string_classes = str
# from torch._six import *
string_classes = str

# 然后再后面找到使用__six函数的地方,把torch.__six.string_classes改为string_classes,如:
if isinstance(resFile, string_classes):

# 也可以直接改成:
if isinstance(resFile, str):