当前位置:网站首页>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
边栏推荐
- Installation and use of blue lake
- Target free or target specific: a simple and effective zero sample position detection comparative learning method
- Play with concurrency: what's the use of interruptedexception?
- FAQ | FAQ for building applications for large screen devices
- PR zero foundation introductory guide note 2
- Handling of inconsistency between cursor and hinttext position in shutter textfield
- Which is better, industrial intelligent gateway or edge computing gateway? How to choose the right one?
- Learn more about materialapp and common attribute parsing in fluent
- A thorough understanding of the development of scorecards - the determination of Y (Vintage analysis, rolling rate analysis, etc.)
- go 函数
猜你喜欢

Jetpack's livedata extension mediatorlivedata

PIP installation of third-party libraries

Actual combat | use composite material 3 in application

Analysis of the overall design principle of Nacos configuration center (persistence, clustering, information synchronization)

Suggestions on settlement solution of u standard contract position explosion

Delete the code you wrote? Sentenced to 10 months!

Yyds dry inventory compiler and compiler tools

Www2022 | know your way back: self training method of graph neural network under distribution and migration

Go language introduction

Shenzhen will speed up the cultivation of ecology to build a global "Hongmeng Oula city", with a maximum subsidy of 10million yuan for excellent projects
随机推荐
初识P4语言
Where can I buy cancer insurance? Which product is better?
How should the team choose the feature branch development mode or trunk development mode?
Installation and use of blue lake
go 函数
Sorted out an ECS summer money saving secret, this time @ old users come and take it away
Pytorch---使用Pytorch实现U-Net进行语义分割
Cloud service selection of enterprises: comparative analysis of SaaS, PAAS and IAAs
How much can a job hopping increase? Today, I saw the ceiling of job hopping.
Common sense of cloud server security settings
[tips] use Matlab GUI to read files in dialog mode
【c语言】动态规划---入门到起立
Introduction to vmware workstation and vSphere
Finally got byte offer. The 25-year-old inexperienced perception of software testing is written to you who are still confused
整理了一份ECS夏日省钱秘籍,这次@老用户快来领走
Sword finger offer II 006 Sort the sum of two numbers in the array
Wechat applet calculates the distance between the two places
Jetpack之LiveData扩展MediatorLiveData
Yyds dry inventory compiler and compiler tools
go 包的使用