プロが教えるわが家の防犯対策術!

閲覧していただきありがとうございます.
初の質問ですので,至らないところもあるかと思いますがどうかよろしくお願いします.


まず,構築環境について記載します.
Macbook air OS X El Capitan 10.11.5
python は anacondaで2.7をインストール済



次に,caffeを実装するうえで現状に至るまで行ったことを記載します.
1.Xcode のインストール
2.Homebrew のインストール
3.Caffe のコードを取得(git clone https://github.com/BVLC/caffe.git
4.pip で必要なソフトウェアをインストール(pip install -r python/requirements.txt)
5.snappy leveldb gflags glog szip lmdbのインストール(for x in snappy leveldb gflags glog szip lmdb homebrew/science/opencv; do brew install --build-from-source --fresh -vd $x; done)
6.Homebrew で protobuf をインストール(brew install --build-from-source --with-python --fresh -vd protobuf)
7.Homebrewで boost などをインストール(brew install --build-from-source --fresh -vd boost boost-python
brew install --build-from-source --fresh -vd hdf5)
8.Makefile.config ファイルを編集(cp Makefile.config.example Makefile.config, emacs Makefile.config)
9.Caffe をビルド&テスト(make clean,make all,make test,make runtest)
10.make pycaffe (←現在ここ)


8.では,今回CPUを使用するので,CPU_ONLY := 1と設定.
  CUSTOM_CXX := /usr/bin/clang++
  BLAS := atlas(openblasを入れたがうまくいかなかったため)に書き換え.
  その他PATHの設定

9.make all を実行した時点でいくつかのwarningが発生.
  ./include/caffe/net.hpp:41:5: warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef]
LOG_EVERY_N(WARNING, 1000) << "DEPRECATED: ForwardPrefilled() "
^
/usr/local/include/glog/logging.h:917:30: note: expanded from macro 'LOG_EVERY_N'
INVALID_REQUESTED_LOG_SEVERITY); \
^
/usr/local/include/glog/logging.h:912:73: note: expanded from macro 'GOOGLE_GLOG_COMPILE_ASSERT'
typedef google::glog_internal_namespace_::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1]
^
1 warning generated.

  や

  clang: warning: argument unused during compilation: '-pthread'


  make testでも同様のエラーが出てたように思います.

  make runtestの実行結果は,すべてokで,[ PASSED ] 1080 tests.と表示されていました.(数字はうろ覚えで曖昧ですが…)


そして問題の10.です.

python/caffe/_caffe.cpp:10:10: fatal error: 'numpy/arrayobject.h' file not found
#include <numpy/arrayobject.h>
^
1 error generated.
make: *** [python/caffe/_caffe.so] Error 1

のエラーがでてしまい,進みません.(PATHの設定を見なおしたり,arrayobject.hが存在するすべてのPATHを突っ込んで見ましたがうまくいかず…)

numpyがインストールされていることも確認しました.

A 回答 (1件)

https://cmake.org/cmake/help/v3.0/command/includ …
では?

PATHは実行ファイルの検索用で、include fileには関係ありません。

あるいは、Cmakefile にPythonを特定するためのオプションは無いですか?
    • good
    • 0
この回答へのお礼

無事解決することができました!ありがとうございます

お礼日時:2016/06/24 11:31

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!