官方文档部署Yolov5时,遇到的问题汇总
官方文档地址:https://gitee.com/ascend/ModelZoo-PyTorch/tree/master/ACL_PyTorch/built-in/cv/Yolov5_for_Pytorch
问题汇总
序号 | 问题 | 原因 | 解决办法 |
1 | ModuleNotFoundError: No module named 'torch' | 缺少依赖包 | |
2 | RuntimeError: Unable to open /dev/urandom | 应该还是缺陷问题,不能打开文件,导致运行时间出错。 | 修改文件的权限 chmod 777 /dev/urandom |
3 | ModuleNotFoundError: No module named '_bz2' | python下缺包 |
添加“”文件包 拷贝python3.6下的该类型包,并修改名字 scp /usr/lib/python3.6/lib-dynload/_bz2.cpython-36m-aarch64-linux-gnu.so 用户名@localhost:/usr/local/python3.7.5/lib/python3.7/lib-dynload/_bz2.cpython-37m-aarch64-linux-gnu.so |
4 | ImportError: libGL.so.1: cannot open shared object file: No such file or directory | 缺少文件 |
若需要添加用户sudo权限,则root用户下执行添加权限操作: usermod libaoshan -G sudo 安装相关依赖: sudo apt-get install libgl1-mesa-glx |
5 | ModuleNotFoundError: No module named '_lzma' | 缺少包 | https://zhuanlan.zhihu.com/p/404162713 |
6 | Sorry, user libaoshan is not allowed to execute '/usr/bin/vim /usr/local/python3.7.5/lib/python3.7/lzma.py' as root on davinci-mini. | 缺少执行权限 | |
7 | AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘ | https://blog.csdn.net/qq_42578742/article/details/123582773 | |
8 | ONNX: export failure: No module named 'onnx' | 缺包 | pip install onnx |
9 | /usr/local/python3.7.5/bin/python3.7: No module named onnxsim | 缺包 | pip install onnx-simplifier |
ModuleNotFoundError: No module named 'onnx.optimizer' | onnx包和onnx-simplifier版本不匹配 |
pip3 install skl2onnx pip install onnx==1.8.1 https://blog.csdn.net/sinat_38685910/article/details/119329283 或者使用源码来解决问题,安装onnx和如下包。 https://github.com/onnx/optimizer |
|
参考:
昇腾论坛 https://bbs.huaweicloud.com/forum/thread-173871-1-1.html