お世話になります。tensorflowのインストールができず困っています。
具体的にはprotobufのコンパイルが通りません。
環境
win10
pc lenovo x201
anaconda3
python 3.7.3 ※3.5をインストールしましたがjupyterインストール時バージョンがあがります。
tensorflow 1.5.0
ためしたこと
https://www.sejuku.net/blog/56695
上記URL2.6 Protobufをコンパイルする まで全て終了
1 TensorFlow Object Detection APIとは 2 Windowsにインストールする 2.1 TensorFlow Modelsをダウンロードする 2.2 Protocol Buffersのコンパイラ(protoc.exe)をインストールする 2.3 GPU版TensorFlowをインストールする 2.4 必要なライブラリをインストールする 2.5 Anacondaのtensorflow-gpu環境にmodels-masterを登録する 2.6 Protobufをコンパイルする→イマココ
エラーの箇所
手順のProtobufをコンパイルする(6)でエラーになります。
python object_detection/builders/model_builder_test.py
のコマンドで以下エラーがでます。
Traceback (most recent call last): File "C:\Users\xxx\Anaconda3\envs\sample-env\lib\site-packages\numpy\core\__init__.py", line 40, in <module> from . import multiarray File "C:\Users\xxx\Anaconda3\envs\sample-env\lib\site-packages\numpy\core\multiarray.py", line 12, in <module> from . import overrides File "C:\Users\xxx\Anaconda3\envs\sample-env\lib\site-packages\numpy\core\overrides.py", line 6, in <module> from numpy.core._multiarray_umath import ( ModuleNotFoundError: No module named 'numpy.core._multiarray_umath' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "object_detection/builders/model_builder_test.py", line 20, in <module> import tensorflow as tf File "C:\Users\xxx\Anaconda3\envs\sample-env\lib\site-packages\tensorflow\__init__.py", line 24, in <module> from tensorflow.python import * File "C:\Users\xxx\Anaconda3\envs\sample-env\lib\site-packages\tensorflow\python\__init__.py", line 47, in <module> import numpy as np File "C:\Users\xxx\Anaconda3\envs\sample-env\lib\site-packages\numpy\__init__.py", line 142, in <module> from . import core File "C:\Users\xxx\Anaconda3\envs\sample-env\lib\site-packages\numpy\core\__init__.py", line 71, in <module> raise ImportError(msg) ImportError: IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE! Importing the multiarray numpy extension module failed. Most likely you are trying to import a failed build of numpy. Here is how to proceed: - If you're working with a numpy git repository, try `git clean -xdf` (removes all files not under version control) and rebuild numpy. - If you are simply trying to use the numpy version that you have installed: your installation is broken - please reinstall numpy. - If you have already reinstalled and that did not fix the problem, then: 1. Check that you are using the Python you expect (you're using C:\Users\xxx\Anaconda3\envs\sample-env\python.exe), and that you have no directories in your PATH or PYTHONPATH that can interfere with the Python and numpy versions you're trying to use. 2. If (1) looks fine, you can open a new issue at https://github.com/numpy/numpy/issues. Please include details on: - how you installed Python - how you installed numpy - your operating system - whether or not you have multiple versions of Python installed - if you built from source, your compiler versions and ideally a build log Note: this error has many possible causes, so please don't comment on an existing issue about this - open a new one instead. Original error was: No module named 'numpy.core._multiarray_umath'
しらべたこと
https://github.com/alpacahq/pylivetrader/issues/73
https://github.com/numpy/numpy/issues/12977
しらべたうえで試したコマンド
numpyアップデート
pip install numpy==1.16.2
結果
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>pip install numpy==1.16.2 Requirement already satisfied: numpy==1.16.2 in c:\users\xxx\anaconda3\envs\sample-env\lib\site-packages (1.16.2)
Numpyを更新した上で
python object_detection/builders/model_builder_test.py
コマンドを打っても、上記同様のエラーになります。
3日ハマって困っています。ご教示頂ければ幸いです。
宜しくお願いします。
追記
同様のチャレンジをされている方をみつけましたが管理者権限でコマンドプロンプトを実行してもsudoできません。
https://qiita.com/genzai/items/12cacec59f0583846b83
C:\WINDOWS\system32>curl -kL https://bootstrap.pypa.io/get-pip.py | sudo python3
'sudo' は、内部コマンドまたは外部コマンド、 操作可能なプログラムまたはバッチ ファイルとして認識されていません。
追記2
for /r %v in (object_detection/protos/*.proto) do protoc object_detection/protos/%~nxv -python_out=.
さらに上記コマンドを打った所以下
Unknown flag: -p
という謎のエラーが大量に出ました。コンパイルが通りません。
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>for /r %v in (object_detection/protos/*.proto) do protoc object_detection/protos/%~nxv -python_out=.
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/anchor_generator.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/argmax_matcher.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/bipartite_matcher.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/box_coder.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/box_predictor.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/calibration.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/eval.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/faster_rcnn.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/faster_rcnn_box_coder.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/graph_rewriter.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/grid_anchor_generator.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/hyperparams.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/image_resizer.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/input_reader.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/keypoint_box_coder.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/losses.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/matcher.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/mean_stddev_box_coder.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/model.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/multiscale_anchor_generator.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/optimizer.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/pipeline.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/post_processing.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/preprocessor.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/region_similarity_calculator.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/square_box_coder.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/ssd.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/ssd_anchor_generator.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/string_int_label_map.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>protoc object_detection/protos/train.proto -python_out=.
Unknown flag: -p
(sample-env) C:\Users\xxx\Anaconda3\models-master\research>
宜しくお願いします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/04/02 06:01