![]() |
重情义的炒粉 · 在 Azure 中的 Active ...· 7 月前 · |
![]() |
踏实的刺猬 · Qt之模型树节点状态恢复(刷新后保持节点展开 ...· 8 月前 · |
![]() |
仗义的竹笋 · Spring Cloud Feign ...· 1 年前 · |
![]() |
谈吐大方的茶叶 · Array.prototype.filter ...· 1 年前 · |
我在试着运行deit colab笔记本电脑
但是我在第二个单元格中遇到了一个问题,特别是
import timm
行,它返回如下:
ImportError:无法从“torch._six”导入名称“container_abcs”
发布于 2021-12-02 02:27:44
发布于 2021-12-23 04:42:09
当我安装torch==1.9.0和torch几何时,旧代码有错误.
这是我的解决方案:
TORCH_MAJOR = int(torch.__version__.split('.')[0])
TORCH_MINOR = int(torch.__version__.split('.')[1])
if TORCH_MAJOR == 0:
import collections.abc as container_abcs
else:
from torch._six import container_abcs
改为:
TORCH_MAJOR = int(torch.__version__.split('.')[0])