OpenCV-OpenVINO
2019年12月10日 - 未分類
OpenCVにOpenVINOが追加されています。ここからダウンロードできます。
しかし、そのままではうまく行きません。
pi@rpi4:~/dldt/model-optimizer/install_prerequisites $ sudo ./install_prerequisites_tf.sh
/home/pi/dldt/model-optimizer/install_prerequisites
/home/pi/dldt/model-optimizer/install_prerequisites/../venv/bin/activate
sudo: 無効なオプション -- 'm'
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-T timeout] [-u user] [VAR=value] [-i|-s] [
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-T timeout] [-u user] file ...
Error on or near line 91; exiting with status 1
このエラーは、
$ sudo touch /etc/lsb-release
とすれば消えます。
pi@rpi4:~/dldt/model-optimizer/install_prerequisites $ sudo ./install_prerequisites_tf.sh
ヒット:1 https://download.docker.com/linux/raspbian buster InRelease
無視:2 http://repo.vivaldi.com/stable/deb stable InRelease
ヒット:3 http://archive.raspberrypi.org/debian buster InRelease
ヒット:4 http://repo.vivaldi.com/stable/deb stable Release
ヒット:5 http://raspbian.raspberrypi.org/raspbian buster InRelease
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
パッケージはすべて最新です。
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
libgfortran3 はすでに最新バージョン (6.5.0-1+rpi1+b1) です。
python3-venv はすでに最新バージョン (3.7.3-1) です。
python3-pip はすでに最新バージョン (18.1-5+rpt1) です。
アップグレード: 0 個、新規インストール: 0 個、削除: 0 個、保留: 0 個。
/home/pi/dldt/model-optimizer/install_prerequisites
/home/pi/dldt/model-optimizer/install_prerequisites/../venv/bin/activate
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: tensorflow<2.0.0,>=1.2.0 in /usr/local/lib/python3.7/dist-packages (from -r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (1.14.0)
Requirement already satisfied: networkx<2.4,>=1.11 in /usr/local/lib/python3.7/dist-packages (from -r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 2)) (2.3)
Requirement already satisfied: numpy>=1.12.0 in /usr/lib/python3/dist-packages (from -r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 3)) (1.16.2)
Requirement already satisfied: defusedxml>=0.5.0 in /usr/local/lib/python3.7/dist-packages (from -r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 4)) (0.6.0)
Requirement already satisfied: six>=1.10.0 in /usr/lib/python3/dist-packages (from tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (1.12.0)
Requirement already satisfied: protobuf>=3.6.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (3.6.1)
Requirement already satisfied: astor>=0.6.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (0.8.0)
Requirement already satisfied: opt-einsum>=2.3.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (3.1.0)
Requirement already satisfied: absl-py>=0.7.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (0.8.1)
Requirement already satisfied: tensorflow-estimator<1.15.0rc0,>=1.14.0rc0 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (1.14.0)
Requirement already satisfied: google-pasta>=0.1.6 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (0.1.8)
Requirement already satisfied: keras-applications>=1.0.8 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (1.0.8)
Requirement already satisfied: tensorboard<2.1.0,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (2.0.2)
Requirement already satisfied: wheel>=0.26; python_version >= "3" in /usr/lib/python3/dist-packages (from tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (0.32.3)
Requirement already satisfied: grpcio>=1.8.6 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (1.25.0)
Requirement already satisfied: gast==0.2.2 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (0.2.2)
Requirement already satisfied: keras-preprocessing>=1.0.5 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (1.1.0)
Requirement already satisfied: termcolor>=1.1.0 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (1.1.0)
Requirement already satisfied: wrapt>=1.11.1 in /usr/local/lib/python3.7/dist-packages (from tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (1.11.2)
Requirement already satisfied: decorator>=4.3.0 in /usr/lib/python3/dist-packages (from networkx<2.4,>=1.11->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 2)) (4.3.0)
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from protobuf>=3.6.1->tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (40.8.0)
Requirement already satisfied: h5py in /usr/lib/python3/dist-packages (from keras-applications>=1.0.8->tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (2.8.0)
Requirement already satisfied: google-auth<2,>=1.6.3 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.1.0,>=2.0.0->tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (1.7.2)
Requirement already satisfied: requests<3,>=2.21.0 in /usr/lib/python3/dist-packages (from tensorboard<2.1.0,>=2.0.0->tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (2.21.0)
Requirement already satisfied: werkzeug>=0.11.15 in /usr/lib/python3/dist-packages (from tensorboard<2.1.0,>=2.0.0->tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (0.14.1)
Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.1.0,>=2.0.0->tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (3.1.1)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /usr/local/lib/python3.7/dist-packages (from tensorboard<2.1.0,>=2.0.0->tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (0.4.1)
Requirement already satisfied: cachetools<3.2,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from google-auth<2,>=1.6.3->tensorboard<2.1.0,>=2.0.0->tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (3.1.1)
Requirement already satisfied: rsa<4.1,>=3.1.4 in /usr/local/lib/python3.7/dist-packages (from google-auth<2,>=1.6.3->tensorboard<2.1.0,>=2.0.0->tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (4.0)
Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.7/dist-packages (from google-auth<2,>=1.6.3->tensorboard<2.1.0,>=2.0.0->tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (0.2.7)
Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/lib/python3/dist-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.1.0,>=2.0.0->tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (1.0.0)
Requirement already satisfied: pyasn1>=0.1.3 in /usr/local/lib/python3.7/dist-packages (from rsa<4.1,>=3.1.4->google-auth<2,>=1.6.3->tensorboard<2.1.0,>=2.0.0->tensorflow<2.0.0,>=1.2.0->-r /home/pi/dldt/model-optimizer/install_prerequisites/../requirements_tf.txt (line 1)) (0.4.8)
[WARNING] All Model Optimizer dependencies are installed globally.
[WARNING] If you want to keep Model Optimizer in separate sandbox
[WARNING] run install_prerequisites.sh venv {caffe|tf|mxnet|kaldi|onnx}
pi@rpi4:~/open_model_zoo/tools/downloader $ python3 ./downloader.py –name mobilenet-ssd
でもgenerator not foundのエラーが出ます。
sudo pip3 install coverage
sudo pip3 install m2r
sudo pip3 install pyenchant
sudo pip3 install pylint,
sudo pip3 install Sphinx,
sudo pip3 install safety
sudo pip3 install test-generator
すればOKです。
MobileNet-SSDを使うための準備。
pi@rpi4:~/open_model_zoo/tools/downloader $ python3 ./downloader.py --name mobilenet-ssd
pi@rpi4:~/dldt/model-optimizer/install_prerequisites $ sudo python3 ~/dldt/model-optimizer/mo.py –input_model /home/pi/open_model_zoo/tools/downloader/public/mobilenet-ssd/mobilenet-ssd.caffemodel –output_dir ~/models/mobilenet-ssd/caffe/output/FP32 –mean_values [127.5,127.5,127.5] –scale_values [127.5]
pi@rpi4:~/dldt/model-optimizer/install_prerequisites $ sudo python3 ~/dldt/model-optimizer/mo.py –input_model /home/pi/open_model_zoo/tools/downloader/public/mobilenet-ssd/mobilenet-ssd.caffemodel –output_dir ~/models/mobilenet-ssd/caffe/output/FP16 –data_type=FP16 –mean_values [127.5,127.5,127.5] –scale_values [127.5]