Closed MichaelToLearn closed 1 year ago
两种解决方式:
降级pytorch 版本:
pip install torchvision==0.10.1 pip install torch==1.9.1
或者改pytorch代码 https://zhuanlan.zhihu.com/p/545926241
没有这两个版本呢
(venv) ➜ yolov5 pip install torchvision==0.10.1
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
ERROR: Could not find a version that satisfies the requirement torchvision==0.10.1 (from versions: 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.2.0, 0.2.1, 0.2.2, 0.2.2.post2, 0.2.2.post3, 0.9.1, 0.10.0, 0.11.1, 0.11.2, 0.11.3, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1)
ERROR: No matching distribution found for torchvision==0.10.1
(venv) ➜ yolov5 pip install torch==1.9.1
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
ERROR: Could not find a version that satisfies the requirement torch==1.9.1 (from versions: 1.8.0, 1.8.1, 1.9.0, 1.10.0, 1.10.1, 1.10.2, 1.11.0, 1.12.0, 1.12.1, 1.13.0, 1.13.1)
ERROR: No matching distribution found for torch==1.9.1
试了试这两个版本:
pip install torch==1.9.0
pip install torchvision==0.10.0
结果是可以转换出来 onxx 的。
按照 https://github.com/lenLRX/Atlas_ACL_E2E_Demo/blob/master/yolov5_model_cvt.md 这个教程转换,使用的是虚拟环境,结果报错: