在运行提供的Pytorch代码时发生以下错误:

原因是Python的int没有上限的,但是C的int有上限,如果没有对大整数做调整,在传入参数时就会出错。
需要打开utils.py文件,将
csv.field_size_limit(sys.maxsize)
修改为
maxInt = sys.maxsize
while True:
# decrease the maxInt value by factor 10
# as long as the OverflowError occurs.
try:
csv.field_size_limit(maxInt)
break
except OverflowError:
maxInt = int(maxInt/10)
另外新版本似乎不会发生该错误,但我自己没有查证。 还是有问题。
625

被折叠的 条评论
为什么被折叠?



