最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

win10+anaconda安裝yolov5的方法及問題解決方案

 更新時間:2021年04月29日 09:57:00   作者:light-124  
這篇文章主要介紹了win10+anaconda安裝yolov5的方法及問題解決方案,本文給大家介紹的非常詳細,對大家的學(xué)習或工作具有一定的參考借鑒價值,需要的朋友可以參考下

對于yolo系列,應(yīng)用廣泛,在win10端也有很大的應(yīng)用需求,所以這篇文章給出win10環(huán)境下的安裝教程。

先給出系列文章win10+anacnda實現(xiàn)yolov3

YOLOV5-3.0/3.1版本

版本問題

python 3.7 torch 1.6.0 torchvision 0.7.0 cuda 10.1

注意:Yolov5-3.1只能使用torch 1.6.0

1.在網(wǎng)站下載對應(yīng)版本的torch和torchvision的whl文件

https://download.pytorch.org/whl/torch_stable.html

2.新建虛擬環(huán)境

conda create -n YOLOV5-3.1 python=3.7

3.查看虛擬環(huán)境

conda info -e

4.激活虛擬環(huán)境

activate YOLOV5-3.1

5.安裝相關(guān)庫

pip3 install opencv-python==4.4.0.46 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install numpy==1.19.2 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install Cython==0.29.21 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install pillow==8.0.1 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install matplotlib==3.3.2 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install pyyaml==5.3.1 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install tensorboard==2.3.0 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install scipy==1.5.2 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install tqdm==4.54.0 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install pandas==1.1.3 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install seaborn==0.11.0 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install pycocotools==2.0.2 -i https://pypi.tuna.tsinghua.edu.cn/simple/

6.安裝torch

將路徑跳轉(zhuǎn)到步驟1中下載的文件位置,使用pip install .....whl 格式來安裝whl文件

7.驗證

import torch
#查看版本
print(torch.__version__)
#查看gpu是否可用.返回True則表示可以使用gpu
torch.cuda.is_available()
#返回設(shè)備gpu個數(shù)
torch.cuda.device_count()

8.圖像檢測

python detect.py

9.調(diào)用攝像頭

python detect.py --source 0

YOLOV5-4.0版本

電腦配置

CPU:i7-10750H

內(nèi)存:16G

顯卡:GTX1650 4G

Anaconda:4.9.2

1.一開始就最好把源換一下

查看當前下載源
 
conda config --show-sources
 
添加源:
 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
 
conda config --set show_channel_urls yes
 
查看當前下載源
 
conda config --show-sources
 
如果出現(xiàn)國內(nèi)源掛掉的情況,就換回默認源
 
conda config --remove-key channels

2.新建虛擬環(huán)境

conda create -n YOLOV5-4.0 python=3.7

3.查看虛擬環(huán)境

conda info -e

4.激活虛擬環(huán)境

activate YOLOV5-4.0

5.安裝相關(guān)庫

注意1:這里不能直接使用pip install -r requirements.txt 這樣直接安裝會默認安裝cpu版本的torch,不知道為什么,可能是torch是其他庫的依賴庫,這里不懂,有會的小伙伴可以一起交流。

注意2:Cv2的版本不能是4.5,需要指定成4.4或者以下。同時Python3.8裝不上cv2 4.4。所以需要安裝python3.7版本,這樣才能將cv2的4.4版本安裝上去。同時在安裝庫的時候需要先安裝opnecv-python,不能先安裝numpy,這樣才能安裝上cv2的4.4版本。

pip3 install opencv-python==4.4.0.46 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install numpy==1.19.2 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install Cython==0.29.21 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install pillow==8.0.1 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install matplotlib==3.3.2 -i https://pypi.tuna.tsinghua.edu.cn/simple/
 
pip3 install pyyaml==5.3.1 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install tensorboard==2.3.0 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install scipy==1.5.2 -i https://pypi.tuna.tsinghua.edu.cn/simple/
 
pip3 install tqdm==4.54.0 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install pandas==1.1.3 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install seaborn==0.11.0 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip3 install pycocotools==2.0.2 -i https://pypi.tuna.tsinghua.edu.cn/simple/

注意:這里需要先安裝opencv-python再安裝numoy,而且opencv-python的版本最好不好是4.5。否則這里會報出CV2函數(shù)的錯誤。

6.安裝torch

我們使用的版本依次是

pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=10.2。

torcp.7版本。Python對應(yīng)3.7版本,否則不能使用cuda。cv2要用4.5以下版本。

YOLOv5最好使用cuda10.2版本

Yolov5 4.0建議搭配torcp.7/yolov5 3.0建議搭配pytorcp.6

安裝方式一:在網(wǎng)站中找到對應(yīng)的版本然后離線安裝

https://download.pytorch.org/whl/torch_stable.html

方式二:

conda install pytorch=1.7.1 torchvision=0.8.2 cudatoolkit=10.2 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

6.驗證

import torch
 
#查看版本
 
print(torch.__version__)
 
#查看gpu是否可用
 
torch.cuda.is_available()
 
#返回設(shè)備gpu個數(shù)
 
torch.cuda.device_count()

7.圖像檢測

python detect.py

8.攝像頭

python detect.py --source 0

9.mp4視頻測試

python detect.py --source 161.mp4 (這里接視頻的位置)

如上圖,視頻已經(jīng)被識別過啦

過程中的一些報錯

報錯1:打開攝像頭報錯

File "D:\BIG-YOLOV5\YOLO\yolov5-4.0\yolov5-4.0\utils\datasets.py", line 276, in __init__

assert cap.isOpened(), 'Failed to open %s' % s AssertionError: Failed to open 0

解決辦法:找到設(shè)備管理器-照相機-右鍵開啟設(shè)備

報錯2:攝像頭報錯

解決辦法:本人用的是聯(lián)想拯救者電腦

1電腦-右鍵屬性-設(shè)備管理器-照相機-點擊開啟

2開始-設(shè)置-隱私-相機-將設(shè)置都打開

3點擊任務(wù)欄上的電池圖標,將攝像頭隱私開啟。

報錯3:在創(chuàng)建虛擬環(huán)境后,安裝庫的時候出現(xiàn)錯誤

WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(139): Could not remove or rename D:\anaconda\pkgs\notebook-6.2.0-py38haa244fe_0.tar.bz2. Please remove this file manually (you may need to reboot to free file handles)

原因:在安裝庫的中途退出了

解決辦法:conda clean --all

報錯4:

An unexpected error has occurred. Conda has prepared the above report.

If submitted, this report will be used by core maintainers to improve

future releases of conda.

解決辦法:conda clean -i

報錯5:cv2版本報錯4.5.1

cv2.error: OpenCV(4.5.1)C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-1drr4hl0\opencv\modules\highgui\src\window.cpp:717: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvWaitKey'

解決辦法:這個錯誤可真是解決太長時間,一直找不到原因,一直試一直試.....

Cv2的版本不能是4.5,需要指定成4.4或者以下。Python3.8裝不上cv2 4.4。所以需要安裝python3.7版本,這樣才能將cv2的4.4版本安裝上去。同時在安裝庫的時候需要先安裝opnecv-python,不能先安裝numpy,這樣才能安裝上cv2的4.4版本。

到此這篇關(guān)于win10+anaconda安裝yolov5的方法及問題解決方案的文章就介紹到這了,更多相關(guān)win10+anaconda安裝yolov5內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Python檢驗用戶輸入密碼的復(fù)雜度

    Python檢驗用戶輸入密碼的復(fù)雜度

    這篇文章主要介紹了Python檢驗用戶輸入密碼的復(fù)雜度,在用戶設(shè)置密碼的時候檢測輸入的密碼大小寫數(shù)字等,需要的朋友可以參考下
    2023-04-04
  • 一文教會你用python連接并簡單操作SQLserver數(shù)據(jù)庫

    一文教會你用python連接并簡單操作SQLserver數(shù)據(jù)庫

    最近要將數(shù)據(jù)寫到數(shù)據(jù)庫里,學(xué)習了一下如何用Python來操作SQLServer數(shù)據(jù)庫,下面這篇文章主要給大家介紹了關(guān)于用python連接并簡單操作SQLserver數(shù)據(jù)庫的相關(guān)資料,需要的朋友可以參考下
    2022-09-09
  • pip install過程中出現(xiàn)error: subprocess-exited-with-error錯誤的解決辦法

    pip install過程中出現(xiàn)error: subprocess-exited-with-erro

    在Python環(huán)境配置過程中,經(jīng)常會遇到各種安裝錯誤,其中一個常見的錯誤是 pip install 過程中出現(xiàn)的 error: subprocess-exited-with-error,在本文中,我將詳細解析這個錯誤的原因,并提供具體的解決方案和步驟,確保大家能夠順利完成安裝,避免類似問題的再次發(fā)生
    2024-07-07
  • Python  pip安裝lxml出錯的問題解決辦法

    Python pip安裝lxml出錯的問題解決辦法

    這篇文章主要介紹了Python pip安裝lxml出錯的問題解決辦法的相關(guān)資料,需要的朋友可以參考下
    2017-02-02
  • next在python中返回迭代器的實例方法

    next在python中返回迭代器的實例方法

    在本篇文章里小編給大家整理的是一篇關(guān)于next在python中返回迭代器的實例方法,有興趣的朋友們可以嘗試下。
    2020-12-12
  • Python實現(xiàn)視頻自動打碼的示例代碼

    Python實現(xiàn)視頻自動打碼的示例代碼

    我們在觀看視頻的時候,有時候會出現(xiàn)一些奇怪的馬賽克,影響我們的觀影體驗,那么這些馬賽克是如何精確的加上去的呢?本文就來為大家詳細講講
    2022-04-04
  • 講解python參數(shù)和作用域的使用

    講解python參數(shù)和作用域的使用

    本文會介紹如何將語句組織成函數(shù),還會詳細介紹參數(shù)和作用域的概念,以及遞歸的概念及其在程序中的用途。
    2013-11-11
  • Python+Tkinter打造簽名設(shè)計工具

    Python+Tkinter打造簽名設(shè)計工具

    這篇文章主要為大家分享如何利用Python Tkinter庫制作帶圖形界面的一個簽名設(shè)計工具,文中的示例代碼講解詳細,感興趣的小伙伴可以了解一下
    2022-04-04
  • Python cookbook(數(shù)據(jù)結(jié)構(gòu)與算法)將名稱映射到序列元素中的方法

    Python cookbook(數(shù)據(jù)結(jié)構(gòu)與算法)將名稱映射到序列元素中的方法

    這篇文章主要介紹了Python cookbook(數(shù)據(jù)結(jié)構(gòu)與算法)將名稱映射到序列元素中的方法,結(jié)合實例形式分析了Python使用collections.namedtuple()進行元組命名相關(guān)操作技巧,需要的朋友可以參考下
    2018-03-03
  • Python進階之@property動態(tài)屬性的實現(xiàn)

    Python進階之@property動態(tài)屬性的實現(xiàn)

    這篇文章主要介紹了Python進階之@property動態(tài)屬性的實現(xiàn),文中通過示例代碼介紹的非常詳細,對大家的學(xué)習或者工作具有一定的參考學(xué)習價值,需要的朋友們下面隨著小編來一起學(xué)習學(xué)習吧
    2019-04-04

最新評論

云安县| 阿图什市| 杭州市| 江源县| 礼泉县| 平舆县| 青州市| 武强县| 平塘县| 定州市| 巴马| 论坛| 恩平市| 泗洪县| 田林县| 海门市| 禹城市| 大宁县| 平定县| 象山县| 柯坪县| 从江县| 老河口市| 宣武区| 弥勒县| 洪雅县| 宣恩县| 虎林市| 黄骅市| 武威市| 黑龙江省| 舞阳县| 庄浪县| 大邑县| 新野县| 武隆县| 朔州市| 横山县| 凉城县| 吴江市| 嘉峪关市|