一、安裝
1 linux+gtx3080
1.7.1修復了不認3系列顯卡的bug。
anaconda3虛環境下:
pip3 install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html --trusted-host mirrors.aliyun.com
cd /home/XXX/dev/yolo/yolov5-3.1
pip3 install -r requirements.txt --trusted-host mirrors.aliyun.com
1.7不行
3080sm_86 pytorch 1.7不認。 要裝nightly 1.8才認。
但是yolov5 目前只支持到pytorch1.7。在pytorch1.8下 最簡單的coco128 train 都報錯。
2 win10+ gtx1060
用yolov5 官網 https://github.com/ultralytics/yolov5
的安裝語句
pip install -r requirements.txt
報
ERROR: Could not find a version that satisfies the requirement torch>=1.6.0 (from -r requirements.txt (line 12)) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
ERROR: No matching distribution found for torch>=1.6.0 (from -r requirements.txt (line 12))
得去pytorch官網首頁選自己的os cuda版本得到安裝語句
pip install torch===1.7.0+cu110 torchvision===0.8.1+cu110 torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html
運行的話,下載torch 的whl有2G,要10多個小時,復制出地址:
https://download.pytorch.org/whl/cu110/torch-1.7.0%2Bcu110-cp38-cp38-win_amd64.whl
直接用迅雷下載搞定
然后繼續運行這個語句,完成pytorch安裝
然后繼續執行
pip install -r requirements.txt
二、運行yolo v5
隨便標注幾張圖像
python train.py --img 240 --batch 16 --epochs 5 --data warship.yaml --weights yolov5s.pt
報錯
OSError: [WinError 1455] 頁面文件太小,無法完成操作。 Error loading "C:\Program Files\Python38\lib\site-packages\torch\lib\cusolverMg64_10.dll" or one of its dependencies.
百度,發現需要在win下設置worker=0
https://blog.csdn.net/weixin_44813425/article/details/107944100
python train.py --img 480 --batch 16 --epochs 5 --workers 0 --weights yolov5s.pt --data warship.yaml

