tensorflowのfully_connected_feed.pyを実行しようとすると、エラーがでます。
2017年5月15日現在で
$ git clone https://github.com/tensorflow/tensorflow
を実行したtensorflowファイルの中で
$ python fully_connected_feed.py
を実行すると以下のようなエラー文が出ます。
Traceback (most recent call last): File "tensorflow/examples/tutorials/mnist/fully_connected_feed.py", line 277, in <module> tf.app.run(main=main, argv=[sys.argv[0]] + unparsed) TypeError: run() got an unexpected keyword argument 'main'
このエラー文で検索してみると、「前のバージョンを使ってみると良いよ」とあったので、
r0.8でブランチ切っているものをインストールしてみました。
$ git clone -b r0.8 --recurse-submodules https://github.com/tensorflow/tensorflow
これで同じように
$ python fully_connected_feed.py
を実行してみると、次は以下のようなエラー文が表示されました。
Extracting data/train-images-idx3-ubyte.gz Extracting data/train-labels-idx1-ubyte.gz Extracting data/t10k-images-idx3-ubyte.gz Extracting data/t10k-labels-idx1-ubyte.gz I tensorflow/core/common_runtime/local_device.cc:40] Local device intra op parallelism threads: 8 I tensorflow/core/common_runtime/direct_session.cc:58] Direct session inter op parallelism threads: 8 Traceback (most recent call last): File "/Users/maru/.pyenv/versions/py350tensorflow/lib/python3.5/site-packages/google/protobuf/internal/python_message.py", line 517, in init copy.MergeFrom(new_val) File "/Users/maru/.pyenv/versions/py350tensorflow/lib/python3.5/site-packages/google/protobuf/internal/python_message.py", line 1208, in MergeFrom "expected %s got %s." % (cls.__name__, type(msg).__name__)) TypeError: Parameter to MergeFrom() must be instance of same class: expected GraphDef got Graph. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "tensorflow/examples/tutorials/mnist/fully_connected_feed.py", line 226, in <module> tf.app.run() File "/Users/maru/.pyenv/versions/py350tensorflow/lib/python3.5/site-packages/tensorflow/python/platform/default/_app.py", line 30, in run sys.exit(main(sys.argv)) File "tensorflow/examples/tutorials/mnist/fully_connected_feed.py", line 222, in main run_training() File "tensorflow/examples/tutorials/mnist/fully_connected_feed.py", line 164, in run_training summary_writer = tf.train.SummaryWriter(FLAGS.train_dir, sess.graph) File "/Users/maru/.pyenv/versions/py350tensorflow/lib/python3.5/site-packages/tensorflow/python/training/summary_io.py", line 103, in __init__ self.add_graph(graph_def) File "/Users/maru/.pyenv/versions/py350tensorflow/lib/python3.5/site-packages/tensorflow/python/training/summary_io.py", line 151, in add_graph event = event_pb2.Event(wall_time=time.time(), graph_def=graph_def) File "/Users/maru/.pyenv/versions/py350tensorflow/lib/python3.5/site-packages/google/protobuf/internal/python_message.py", line 519, in init _ReraiseTypeErrorWithFieldName(message_descriptor.name, field_name) File "/Users/maru/.pyenv/versions/py350tensorflow/lib/python3.5/site-packages/google/protobuf/internal/python_message.py", line 450, in _ReraiseTypeErrorWithFieldName six.reraise(type(exc), exc, sys.exc_info()[2]) File "/Users/maru/.pyenv/versions/py350tensorflow/lib/python3.5/site-packages/six.py", line 685, in reraise raise value.with_traceback(tb) File "/Users/maru/.pyenv/versions/py350tensorflow/lib/python3.5/site-packages/google/protobuf/internal/python_message.py", line 517, in init copy.MergeFrom(new_val) File "/Users/maru/.pyenv/versions/py350tensorflow/lib/python3.5/site-packages/google/protobuf/internal/python_message.py", line 1208, in MergeFrom "expected %s got %s." % (cls.__name__, type(msg).__name__)) TypeError: Parameter to MergeFrom() must be instance of same class: expected GraphDef got Graph. for field Event.graph_def
最後の行のエラー文で検索してみると、次は「最新バージョンをインストールすることを強くおすすめします」とありました。
どこに問題があるのでしょうか。
ご存じの方がいらっしゃればよろしくお願いします。
あなたの回答
tips
プレビュー