当前位置:网站首页>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
边栏推荐
- 【leetcode】81. Search rotation sort array II
- Feature Engineering: summary of common feature transformation methods
- Spring recruitment of Internet enterprises: Kwai meituan has expanded the most, and the annual salary of technical posts is up to nearly 400000
- The confusion I encountered when learning stm32
- BiShe cinema ticket purchasing system based on SSM
- L'avènement de l'ère 5G, une brève discussion sur la vie passée et présente des communications mobiles
- FAQ | FAQ for building applications for large screen devices
- Pandora IOT development board learning (HAL Library) - Experiment 2 buzzer experiment (learning notes)
- Hands on deep learning (II) -- multi layer perceptron
- go 包的使用
猜你喜欢

Suggestions on settlement solution of u standard contract position explosion

Document declaration and character encoding

集成底座方案演示说明

Jetpack之LiveData扩展MediatorLiveData

Yyds dry inventory compiler and compiler tools

Force buckle 540 A single element in an ordered array

C语言:逻辑运算和判断选择结构例题

Sorted out an ECS summer money saving secret, this time @ old users come and take it away

Pytoch --- use pytoch to predict birds

深圳打造全球“鸿蒙欧拉之城”将加快培育生态,优秀项目最高资助 1000 万元
随机推荐
The original author is out! Faker. JS has been controlled by the community..
L'avènement de l'ère 5G, une brève discussion sur la vie passée et présente des communications mobiles
Pandora IOT development board learning (HAL Library) - Experiment 2 buzzer experiment (learning notes)
【leetcode】81. Search rotation sort array II
Jetpack之LiveData扩展MediatorLiveData
Feature Engineering: summary of common feature transformation methods
Handling of inconsistency between cursor and hinttext position in shutter textfield
The difference between vectorresize and reverse.
Raspberry pie GPIO pin controls traffic light and buzzer
向数据库中存入数组数据,代码出错怎么解决
Pytoch --- use pytoch for image positioning
uni-app - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
PIP installation of third-party libraries
树莓派GPIO引脚控制红绿灯与轰鸣器
【c语言】动态规划---入门到起立
PR zero foundation introductory guide note 2
Wechat applet map annotation
Déchirure à la main - tri
Www 2022 | rethinking the knowledge map completion of graph convolution network
C语言猜数字游戏