Windows anaconda 運行yolov3

1 建立yolo環境
conda creat -n yolo python=3.6
更換conda源,下載軟件的時候會快些python

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
建立後進入yolo環境,並安裝Keras和tensorflow,我這塊安裝的是gpu版本的tensorflowgit

source activate yolo
pip install keras==2.1.5
pip install tensorflow-gpu==1.6.0 #若是是gpu版本
pip install tensorflow==1.6.0 #若是是cpu版本
注意,這兩個是二選一
2 安裝依賴
在訓練的過程當中,會有不少依賴,因此提早安裝一遍github

pip install Pillow
pip install matplotlib
conda install ffmpeg
pip install opencv-contrib-python
pip install opencv-pythonide

pip install h5pyurl

一、下載yolov3代碼:https://github.com/qqwweee/keras-yolo3 ,並解壓縮以後用pycharm打開。blog

      二、下載權重:https://pjreddie.com/media/files/yolov3.weights並將權重放在keras-yolo3的文件夾下。以下圖所示:ip

 三、執行以下命令將darknet下的yolov3配置文件轉換成keras適用的h5文件。pycharm

             python convert.py yolov3.cfg yolov3.weights model_data/yolo.h5input

 

運行:
python yolo_video.py --gpu_num=1 –input=test.mp4 --output=2.mp4it

若是出現Failed to load the native TensorFlow runtime.

則,

解決辦法就是:pip install --upgrade --ignore-installed tensorflow

更新一下tensorflow就行了

相關文章
相關標籤/搜索