-
Notifications
You must be signed in to change notification settings - Fork 8
DeepLearning PyTorch YOLOv3
Eiichiro Momma edited this page Dec 13, 2018
·
2 revisions
CUDA9以上の場合、こっちのやりかただとCUDA8でコンパイルしたtorchを使う羽目になって延々と待たされるので、pytorchを入れ替える必要がある。 gitから拾ってきてそのまま使おうとすると
from models.yolov3 import *
model = YOLOv3()
model.cuda(1)
/home/xxxx/python3.6/site-packages/torch/cuda/__init__.py:114: UserWarning:
Found GPU0 GeForce RTX 2080 which requires CUDA_VERSION >= 9000 for
optimal performance and fast startup time, but your PyTorch was compiled
with CUDA_VERSION 8000. Please install the correct PyTorch binary
using instructions from http://pytorch.org
warnings.warn(incorrect_binary_warn % (d, name, 9000, CUDA_VERSION))
と出る。demo.pyを使おうとすると時間がかかるのもこのせい。
$ git clone https://github.com/DeNA/PyTorch_YOLOv3.git
$ cd PyTorch_YOLOv3
$ conda create -n PyTorchYOLOv3 python==3.6.7 numpy cython
$ source activate PyTorchYOLOv3
$ pip install -r requirements/requirements.txt
$ pip uninstall torch
$ conda install pytorch torchvision cuda90 -c pytorch
でようやく使える準備が整う。
from models.yolov3 import *
model = YOLOv3()
model.cuda(0) # GPU Id
で、層の構成が直ぐにずらっと出れば成功(色々warningは出る)。demo.pyを動かす。
$ python demo.py --image data/mountain.png --detect_thresh 0.5 --weights_path weights/yolov3.weights
/home/xxxx/python3.6/site-packages/torch/nn/_reduction.py:49: UserWarning: size_average and reduce args will be deprecated, please use reduction='sum' instead.
warnings.warn(warning.format(ret))
loading yolo weights weights/yolov3.weights
THCudaCheck FAIL file=/opt/conda/conda-bld/pytorch_1544174967633/work/aten/src/THC/THCGeneral.cpp line=405 error=11 : invalid argument
/home/xxxx/python3.6/site-packages/torch/nn/modules/upsampling.py:129: UserWarning: nn.Upsample is deprecated. Use nn.functional.interpolate instead.
warnings.warn("nn.{} is deprecated. Use nn.functional.interpolate instead.".format(self.name))
199 243 234 272 0.9996639490127563 2
+ Label: car, Conf: 0.87267
116 240 160 288 0.990776777267456 19
+ Label: cow, Conf: 0.95761
実行時に
lib/python3.6/site-packages/torch/lib/libtorch_python.so: undefined symbol: PySlice_Unpack
が出たらpythonのバージョンが3.6.0なのが悪いらしい。3.6.xの新しいのを使う。
- 3ds_max
- Android
- Books
- Caffe
- Canvas
- Chainer
- CloudCompare
- colinux
- colmap
- Cygwin
- DeepLearning
- DICOM
- dlib
- docker
- Everun
- Excel
- EyeX
- FANN
- FDS
- Felica
- FreeBSD
- FreeNAS
- GAlib
- gnuplot
- JetsonNano
- JetsonTK1
- JetsonTX2
- Kinect
- LAPACK
- LaTeX
- LTspice
- M5Stack
- MacOSX
- MATLAB
- Memo
- MicroEnableIII
- Mono
- MSVC
- nano
- nvidia-docker
- ODE
- Open3D
- OpenCV
- OpenCVSharp
- OpenMVG
- OpenOffice
- OpenVSLAM
- OSG
- ParaView
- PCL
- Phidgets
- PlaidML
- PLplot
- POVRay
- PowerPoint
- Python
- R
- RaspberryPi
- Realsense
- ROS
- RSJ2011
- Ruby
- Scilab
- SHOGUN
- SUSE
- SVM
- Tensorflow
- TrueCrypt
- Ubuntu
- uEye
- Unix
- VMWarePlayer
- Vim
- VTK
- Windows
- WSL2
- 文書作成
- 文献調査
- 立体映像
- 論文メモ