0

http://qiita.com/t_shinmura/items/066b696d82f9919480ae
上のページの
https://github.com/TakuyaShinmura/conv_lstm
にあるソースコードのtrain.pyをそのまま実行した結果、

WARNING:tensorflow:<conv_lstm_cell.ConvLSTMCell object at 0x7f3797af4be0>: Using a concatenated state is slower and will soon be deprecated.  Use state_is_tuple=True.
Traceback (most recent call last):
  File "/home/user/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/framework/tensor_shape.py", line 563, in merge_with
    self.assert_same_rank(other)
  File "/home/user/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/framework/tensor_shape.py", line 609, in assert_same_rank
    "Shapes %s and %s must have the same rank" % (self, other))
ValueError: Shapes (?, 64, 64, 3) and (?, ?) must have the same rank

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/framework/tensor_shape.py", line 639, in with_rank
    return self.merge_with(unknown_shape(ndims=rank))
  File "/home/user/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/framework/tensor_shape.py", line 570, in merge_with
    (self, other))
ValueError: Shapes (?, 64, 64, 3) and (?, ?) are not compatible

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "train.py", line 137, in <module>
    tf.app.run()
  File "/home/user/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 30, in run
    sys.exit(main(sys.argv))
  File "train.py", line 78, in main
    result = inference(images)
  File "train.py", line 43, in inference
    outputs, state = tf.nn.rnn(cell=cell, inputs=images, dtype=tf.float32)
  File "/home/user/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/ops/rnn.py", line 113, in rnn
    (fixed_batch_size, input_size) = inputs[0].get_shape().with_rank(2)
  File "/home/user/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/framework/tensor_shape.py", line 641, in with_rank
    raise ValueError("Shape %s must have rank %d" % (self, rank))
ValueError: Shape (?, 64, 64, 3) must have rank 2

とエラーが出ましたが、原因がわかりません。
何故このようなエラーが出るのか教えてくださると助かります。

2
  • ご提示頂いたコードを当方にて実行してみましたが、エラーは出ず訓練まで実行できることを確認しました。tensorflowのVersionは0.12.0-rc1です。
    – H.H
    2017年1月17日 5:48
  • 最新のバージョンに更新した結果、正しく実行することができました。ありがとうございました。
    – user20244
    2017年1月17日 18:03

1 件の回答 1

1

コメントの指摘から、バージョンを変更した結果解決しました。ありがとうございました。

2
  • 1
    FWIW: レビューをミスしました。これは、回答として適格な回答だと思います。
    – Yuki Inoue
    2017年1月17日 19:27
  • 変更前と後のバージョンを回答に記載すると後から参照する人の役に立つかと思いますのでご検討ください。
    – harry0000
    2017年1月18日 18:27

この質問に回答するには、ログインする必要があります。

求めていた回答ではありませんか? のタグが付いた他の質問を参照する。