【报错】cannot import name ‘container_abcs‘ from ‘torch._six‘

1 报错:cannot import name ‘container_abcs’ from ‘torch._six’

解决办法:
from torch._six import container_abcs
改成以下写法
import collections.abc as container_abcs

2 报错:cannot import name ‘int_classes’ from ‘torch._six’

解决办法:
int_classes = int

整体效果如下:
【报错】cannot import name ‘container_abcs‘ from ‘torch._six‘_第1张图片

你可能感兴趣的:(报错处理,python)