LoginSignup
0
2

More than 5 years have passed since last update.

Object Detection API 導入手順の補足(Mac版)

Posted at

概要

Object Detection APIのMacへの導入で、つまずいた点を記します。

環境

導入先:macOS Hight Sierra

Object Detection APIの導入手順

導入手順は、こちらに記載あります。
https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md

つまずいた点

1. tensorflowの導入ディレクトリにmodels/researchがない

COCO API installationで、以下の手順があります。

cp -r pycocotools <path_to_tensorflow>/models/research/

tensorflowのインストールディレクトリを見ても、models/researchはありません。

tensorflowをpipでインストールするだけではなく、modelをダウンロードする必要があります。下記をダウンロードすればOKです。

2. protocが実行できない

Protobuf Compilationで、以下の手順があります。

protoc object_detection/protos/*.proto --python_out=.

Dependenciesのインストールに記載されている下記を実施するだけでは、protocを実行できません。

Alternatively, users can install dependencies using pip:
pip install --user Cython
pip install --user contextlib2
pip install --user pillow
pip install --user lxml
pip install --user jupyter
pip install --user matplotlib

brewで、protobufを導入する必要があります。

brew install protobuf

しかし、途中でエラーしました。権限エラーです。

Error:[0m Permission denied @ dir_s_mkdir - /usr/local/Frameworks

対応として、brew installする前に、sudoで事前に/usr/local/Frameworksディレクトリを作成しておきます。

sudo mkdir /usr/local/Frameworks

これで導入がうまくいき、protocを実行できます。

導入確認

最後は下記で導入確認できます。

python object_detection/builders/model_builder_test.py
......................
----------------------------------------------------------------------
Ran 22 tests in 0.167s

OK
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2