当前位置:网站首页>Pytoch yolov5 runs bug solution from 0:
Pytoch yolov5 runs bug solution from 0:
2022-07-02 04:15:00 【_ kx_】
Directory hyperlink :
- Q: You need to install the corresponding version of pytorch 、 torchvision 、opencv Wait for a series of libraries , Where to install it ?( How to change the source perfectly )
- Q: import cv2 appear libGL.so.1: cannot open shared object file: No such file or directory
- Q:AttributeError: ‘Upsample’ object has no attribute ‘recompute_scale_factor’
technological process : docker After creating the image , Installation in mirror anaconda after , Create good yolov5 Environment
Q: You need to install the corresponding version of pytorch 、 torchvision 、opencv Wait for a series of libraries , Where to install it ?( How to change the source perfectly )
Details: however Anacodna The default source is foreign , It will cause us to install things very slowly ,pip (python The source of package management tools is also foreign , We need to change the source 、 Or when it's installed , Temporary source change )
resolvent :
1. anaconda When adding sources , Be sure to write http Do not write https
# Execute the command on the terminal command line
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
After execution , You'll find out home There is one more... In the catalog .condarc The file of
- vim ~/.condarc
The contents are as follows :
channels:
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
thus , Source change successful , According to the official website pytorch Install the command to install .
- Bear in mind , Remove the end of -c Ptyorch ( -c, Refer to -channel from Pytorch Official website installation , Particularly slow , There is a high probability of failure )
- Pytorch Official website :
- https://pytorch.org/
- The old version :https://pytorch.org/get-started/previous-versions/
2. pip Source change
# tsinghua :
https://pypi.tuna.tsinghua.edu.cn/simple
# Alibaba cloud :
http://mirrors.aliyun.com/pypi/simple/
# douban :
http://pypi.douban.com/simple/
- yolov5 Under the installation command ( Directly pull and install yolov5 All libraries under the corresponding version ):
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple –-trusted-host pypi.douban.com
Q:import cv2 appear libGL.so.1: cannot open shared object file: No such file or directory
resolvent :
pip install opencv-python-headless
Reference from :https://blog.csdn.net/qq_50195602/article/details/124188467
This brother explained more thoroughly , Even talked about how to dockerfile Add installation instructions , To avoid this problem .
Q:AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor'
describe : My reasoning yolov5 The error occurred when demonstrating the example image .
reason : torch and torchvision Version mismatch caused by ;
resolvent :
- Install the matching version
- change upsample.py The code in , Remove the parameter of the function
Reference resources : https://blog.csdn.net/qq_40280673/article/details/125095353
边栏推荐
- SQL: common SQL commands
- 文档声明与字符编码
- 《西线无战事》我们才刚开始热爱生活,却不得不对一切开炮
- 微信小程序 - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
- 集成底座方案演示说明
- Which is better, industrial intelligent gateway or edge computing gateway? How to choose the right one?
- L'avènement de l'ère 5G, une brève discussion sur la vie passée et présente des communications mobiles
- 《动手学深度学习》(二)-- 多层感知机
- LCM of Spreadtrum platform rotates 180 °
- 【力扣刷题】15.三数之和(双指针);17.电话号码的字母组合(递归回溯)
猜你喜欢
Suggestions on settlement solution of u standard contract position explosion
Yolov5网络修改教程(将backbone修改为EfficientNet、MobileNet3、RegNet等)
The original author is out! Faker. JS has been controlled by the community..
Wpviewpdf Delphi and Net PDF viewing component
【c语言】基础篇学习笔记
Pytoch --- use pytoch to realize u-net semantic segmentation
Hands on deep learning (II) -- multi layer perceptron
深圳打造全球“鸿蒙欧拉之城”将加快培育生态,优秀项目最高资助 1000 万元
[tips] use Matlab GUI to read files in dialog mode
Pytorch---使用Pytorch实现U-Net进行语义分割
随机推荐
Installation et utilisation du lac bleu
集成底座方案演示说明
Pytorch---使用Pytorch实现U-Net进行语义分割
IDEA xml中sql没提示,且方言设置没用。
The difference between vectorresize and reverse.
Pytoch --- use pytoch for image positioning
Shutdown procedure after 60
Wechat applet pull-down loading more waterfall flow loading
藍湖的安裝及使用
初识P4语言
Jetpack之LiveData扩展MediatorLiveData
Li Kou interview question 02.08 Loop detection
[JS event -- event flow]
Cloud service selection of enterprises: comparative analysis of SaaS, PAAS and IAAs
go 变量与常量
Sword finger offer II 006 Sort the sum of two numbers in the array
Déchirure à la main - tri
Wechat applet calculates the distance between the two places
Fluent icon demo
SQL: common SQL commands