環境
AWSのDeep learning AMIを使ってEC2上で動かしています。
source activate tensorflow_p36し、
pip install -U tensorflowした状態で、
実行コマンドは下記です。(X)
python
1python object_detection/model_main.py --pipeline_config_path=configs/faster_rcnn_resnet101_voc07.config --model_dir=data/output-model/ --num_train_steps=50000 --sample_1_of_n_eval_examples=1 --alsologtostderr
https://github.com/tensorflow/models/blob/master/research/object_detection
問題
以下をobject_detection/model_main.pyに追加して、Xを実行すると
python
1from tensorflow.python.client import device_lib 2print(device_lib.list_local_devices())
2018-11-09 18:12:12.582533: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Device mapping:
/job:localhost/replica:0/task:0/device:XLA_CPU:0 -> device: XLA_CPU device
2018-11-09 18:12:12.591782: I tensorflow/core/common_runtime/direct_session.cc:307] Device mapping:
/job:localhost/replica:0/task:0/device:XLA_CPU:0 -> device: XLA_CPU device
とログに出てきて、GPUが使えていないようです。
やったこと
調べてみると、pip install tensorflow-gpu
を実行すればGPU使って学習できるいう記事を見つけたので、
https://github.com/tensorflow/models/issues/3366
以下を実行してからコードXを実行しました。
bash
1pip uninstall tensorflow 2pip uninstall tensorflow-gpu 3pip install -U tensorflow-gpu
しかし下記のエラーがでます。(少なくとも確認した限りバージョン:1.6,1.8,1.11で発生)
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
これの解決策としては、tensorflow-gpu:1.4にするといいようです。
https://github.com/tensorflow/tensorflow/issues/15604
そこで、下記を実行してコードXを実行しました。
bash
1pip uninstall tensorflow 2pip uninstall tensorflow-gpu 3pip install --upgrade tensorflow-gpu==1.4
しかしAttributeError: module 'tensorflow.python.keras' has no attribute 'Model'
というエラーが出ます。
これの解決策としては、pip install -U tensorflowを実行することが提案されており、無限ループに陥ってしまっています。
https://github.com/tensorflow/tensorflow/issues/21927
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。