当前位置:网站首页>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
边栏推荐
- Use a mask to restrict the input of the qlineedit control
- How to solve the problem that objects cannot be deleted in Editor Mode
- Go branch and loop
- [JS event -- event flow]
- LCM of Spreadtrum platform rotates 180 °
- 2022-07-01:某公司年会上,大家要玩一食发奖金游戏,一共有n个员工, 每个员工都有建设积分和捣乱积分, 他们需要排成一队,在队伍最前面的一定是老板,老板也有建设积分和捣乱积分, 排好队后,所有
- [live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!
- uni-app - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
- The confusion I encountered when learning stm32
- Force buckle 540 A single element in an ordered array
猜你喜欢
The original author is out! Faker. JS has been controlled by the community..
《动手学深度学习》(二)-- 多层感知机
[source code analysis] NVIDIA hugectr, GPU version parameter server - (1)
go 包的使用
深圳打造全球“鸿蒙欧拉之城”将加快培育生态,优秀项目最高资助 1000 万元
[ibdfe] matlab simulation of frequency domain equalization based on ibdfe
Which is better, industrial intelligent gateway or edge computing gateway? How to choose the right one?
Spring moves are coming. Watch the gods fight
A summary of common interview questions in 2022, including 25 technology stacks, has helped me successfully get an offer from Tencent
A thorough understanding of the development of scorecards - the determination of Y (Vintage analysis, rolling rate analysis, etc.)
随机推荐
Realizing deep learning framework from zero -- Introduction to neural network
《西线无战事》我们才刚开始热爱生活,却不得不对一切开炮
66.qt quick QML Custom Calendar component (supports vertical and horizontal screens)
Is the product of cancer prevention medical insurance safe?
Which product of anti-cancer insurance is better?
cookie、session、tooken
go 包的使用
Lei Jun wrote a blog when he was a programmer. It's awesome
如何解决在editor模式下 无法删除物体的问题
[personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network
C语言:逻辑运算和判断选择结构例题
深圳打造全球“鸿蒙欧拉之城”将加快培育生态,优秀项目最高资助 1000 万元
Sword finger offer II 006 Sort the sum of two numbers in the array
Recently, the weather has been extremely hot, so collect the weather data of Beijing, Shanghai, Guangzhou and Shenzhen last year, and make a visual map
SQL:常用的 SQL 命令
uni-app - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
Finally got byte offer. The 25-year-old inexperienced perception of software testing is written to you who are still confused
Wechat applet - realize the countdown of 60 seconds to obtain the mobile verification code (mobile number + verification code login function)
Introduction to vmware workstation and vSphere
regular expression