当前位置:网站首页>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
边栏推荐
- How should the team choose the feature branch development mode or trunk development mode?
- uni-app - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
- Spring recruitment of Internet enterprises: Kwai meituan has expanded the most, and the annual salary of technical posts is up to nearly 400000
- 【leetcode】81. Search rotation sort array II
- Go variables and constants
- Lei Jun wrote a blog when he was a programmer. It's awesome
- 微信小程序 - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
- Qt插件之Qt Designer插件实现
- Recyclerview add header
- WiFi 5GHz frequency
猜你喜欢

Common sense of cloud server security settings

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

【leetcode】74. Search 2D matrix

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

BiShe cinema ticket purchasing system based on SSM

《西线无战事》我们才刚开始热爱生活,却不得不对一切开炮

Pandora IOT development board learning (RT thread) - Experiment 1 LED flashing experiment (learning notes)

Suggestions on settlement solution of u standard contract position explosion

How to model noise data? Hong Kong Baptist University's latest review paper on "label noise representation learning" comprehensively expounds the data, objective function and optimization strategy of

Pytoch --- use pytoch for image positioning
随机推荐
go 变量与常量
Déchirure à la main - tri
Wpviewpdf Delphi and Net PDF viewing component
Yolov5网络修改教程(将backbone修改为EfficientNet、MobileNet3、RegNet等)
手撕——排序
Yolov5 network modification tutorial (modify the backbone to efficientnet, mobilenet3, regnet, etc.)
Installation et utilisation du lac bleu
5G時代全面到來,淺談移動通信的前世今生
Wechat applet JWT login issue token
Demonstration description of integrated base scheme
初识P4语言
Pytoch --- use pytoch for image positioning
Go variables and constants
SQL: common SQL commands
go 函数
深圳打造全球“鸿蒙欧拉之城”将加快培育生态,优秀项目最高资助 1000 万元
C language: examples of logical operation and judgment selection structure
Dare to go out for an interview without learning some distributed technology?
Common sense of cloud server security settings
Three ways for programmers to learn PHP easily and put chaos out of order