栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

(遇到问题)安装timm的时候torch版本被改变导致无法使用(未解决)

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

(遇到问题)安装timm的时候torch版本被改变导致无法使用(未解决)

但是运行遇到第二个问题

importError: cannot import name container_abcs from torch._six (/home/nk/anaconda3/envs/SINet-pytorch/lib/python3.7/site-packages/torch/_six.py)

3 查看了下torch 的版本

torch.__version__
1.9.1 cu102

4 参考下面博客说法 尝试降低下版本
pip install torch 1.8.1 torchvision

  1.cannot import name ‘container_abcs‘ from ‘torch._six‘_aigonna-CSDN博客问题描述 在导入torch或torchvision 中 由于torchvision与torch版本不匹配 torchvision无法导入 出现importError: cannot import name container_abcs from torch._six (/usr/local/lib/python3.7/dist-packages/torch/_six.py)解决方案 查看自己的版本torch.__version__ torchvision.__version__ 如1.9https://blog.csdn.net/weixin_39754630/article/details/119854333?ops_request_misc %257B%2522request%255Fid%2522%253A%2522163263137316780262531504%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D request_id 163263137316780262531504 biz_id 0 utm_medium distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-1-119854333.pc_search_all_es utm_term importError%3A cannot import name %27container_abcs%27 from %27torch._six%27 spm 1018.2226.3001.4187

5 再次运行发现驱动太老了

RuntimeError: The NVIDIA driver on your system is too old (found version 10000). Please update your GPU driver by downloading and installing a new version from the URL: http://www.nvidia.com/Download/index.aspx Alternatively, go to: https://pytorch.org to install a PyTorch version that has been compiled with your version of the CUDA driver.

6 查看当前版本

torch.__version__
1.8.1 cu102

7 尝试安装torch 1.0

pip install torch 1.0 torchvision

但是不知道timm支不支持这个版本

出现下面说明

 timm和pytorch-lightning都需要1.4以上的torch版本 而cuda需要10.1才能安装1.4的torch。
而我的cuda是10.0的 因此只能重新安装cuda
用此指令查看cuda版本
cat /usr/local/cuda/version.txt

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/266793.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号