tensorflowの画像認識モデルとして評判の良いresnetをgithubからcloneして利用しようとして、まずはmnistを実行しようとしたら、次のエラーメッセージが出ました。
[error message]
from official.mnist import dataset
ImportError: No module named 'official'
Process finished with exit code 1
ソースコードには確かに次の文がはいっています。
[import statements]
import tensorflow as tf # pylint: disable=g-bad-import-order
from official.mnist import dataset
from official.utils.arg_parsers import parsers
from official.utils.logs import hooks_helper
from official.utils.misc import model_helpers
その対応策として、githubには次の記述がありました。
Running the models
The Official Models are made available as a Python module. To run the models and associated scripts, add the top-level /models folder to the Python path with the command: export PYTHONPATH="$PYTHONPATH:/path/to/models"
To install dependencies pass -r official/requirements.txt to pip. (i.e. pip3 install --user -r official/requirements.txt)
To make Official Models easier to use, we are planning to create a pip installable Official Models package. This is being tracked in #917.
しかし、環境はPycharmなので、上記コマンドの実行ができまいことと、linuxで行おうとしたらそれでもうまくいきませんでした。
このofficialというモジュールを使えるようにするには、どうしたらよろしいでしょうか。環境はつぎのとおりです。
【環境】
Windows10
Pycharm
Python3.5
tensorflow1.7.0
それでは、よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー