电脑配置:win10 CUDA 11.6
https://github.com/hukaixuan19970627/yolov5_obb
一、conda创建虚拟环境
conda create -n obb python=3.9
激活虚拟环境
conda activate obb
二、在虚拟环境中安装PyTorch和torchvision
pip3 install torch==1.10.1+cu113 torchvision==0.11.2+cu113 torchaudio==0.10.1+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
三、下载项目
下载地址:https://github.com/hukaixuan19970627/yolov5_obb
四、安装依赖项
cd yolov5_obb-master
pip install -r requirements.txt
cd utils/nms_rotated
python setup.py develop
这里报错Error compiling objects for extension,需要替换utils\nms_rotated\src下的poly_nms_cuda.cu。
替换后再运行:
python setup.py develop
参考issue:
https://github.com/hukaixuan19970627/yolov5_obb/issues/224
五、遇到的报错与解决方式
labels, shapes, self.segments = zip(*cache.values()) ValueError: not enough values to unpack (expected 3, got 0)
pip install numpy==1.22
attributeerror: 'FreeTypeFont' object has no attribute 'getsize’
pip install pillow==9.5