PhasedLSTM-Keras icon indicating copy to clipboard operation
PhasedLSTM-Keras copied to clipboard

Information: Keras 2.2.0 doesn't work with examples due to a known issue

Open nicolefinnie opened this issue 6 years ago • 0 comments

I rand the random_example.py with the latest Keras 2.2.0 and hit the following error while_loop() got an unexpected keyword argument maximum_iterations. Someone from the tensorflow repository suggested using Keras 2.1.5, so I downgraded my Keras to 2.1.5 and it bypassed this error.

Reference https://github.com/tensorflow/tensorflow/issues/20075

Error

(plstm_keras) nicole@polarsnow:~/git/PhasedLSTM-Keras/examples(master)$ python random_example.py 
/home/nicole/anaconda3/envs/plstm_keras/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
Using TensorFlow backend.
Traceback (most recent call last):
  File "random_example.py", line 31, in <module>
    main()
  File "random_example.py", line 13, in main
    model_lstm.add(LSTM(10, input_shape=(100, 2)))
  File "/home/nicole/anaconda3/envs/plstm_keras/lib/python3.6/site-packages/keras/engine/sequential.py", line 166, in add
    layer(x)
  File "/home/nicole/anaconda3/envs/plstm_keras/lib/python3.6/site-packages/keras/layers/recurrent.py", line 500, in __call__
    return super(RNN, self).__call__(inputs, **kwargs)
  File "/home/nicole/anaconda3/envs/plstm_keras/lib/python3.6/site-packages/keras/engine/base_layer.py", line 460, in __call__
    output = self.call(inputs, **kwargs)
  File "/home/nicole/anaconda3/envs/plstm_keras/lib/python3.6/site-packages/keras/layers/recurrent.py", line 2112, in call
    initial_state=initial_state)
  File "/home/nicole/anaconda3/envs/plstm_keras/lib/python3.6/site-packages/keras/layers/recurrent.py", line 609, in call
    input_length=timesteps)
  File "/home/nicole/anaconda3/envs/plstm_keras/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2957, in rnn
    maximum_iterations=input_length)
TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations'
ERROR:tensorflow:==================================
Object was never used (type <class 'tensorflow.python.ops.tensor_array_ops.TensorArray'>):
<tensorflow.python.ops.tensor_array_ops.TensorArray object at 0x7fcaa7c49ba8>
If you want to mark it as used call its "mark_used()" method.
It was originally created here:
['File "random_example.py", line 31, in <module>\n    main()', 'File "random_example.py", line 13, in main\n    model_lstm.add(LSTM(10, input_shape=(100, 2)))', 'File "/home/nicole/anaconda3/envs/plstm_keras/lib/python3.6/site-packages/keras/engine/sequential.py", line 166, in add\n    layer(x)', 'File "/home/nicole/anaconda3/envs/plstm_keras/lib/python3.6/site-packages/keras/layers/recurrent.py", line 500, in __call__\n    return super(RNN, self).__call__(inputs, **kwargs)', 'File "/home/nicole/anaconda3/envs/plstm_keras/lib/python3.6/site-packages/keras/engine/base_layer.py", line 460, in __call__\n    output = self.call(inputs, **kwargs)', 'File "/home/nicole/anaconda3/envs/plstm_keras/lib/python3.6/site-packages/keras/layers/recurrent.py", line 2112, in call\n    initial_state=initial_state)', 'File "/home/nicole/anaconda3/envs/plstm_keras/lib/python3.6/site-packages/keras/layers/recurrent.py", line 609, in call\n    input_length=timesteps)', 'File "/home/nicole/anaconda3/envs/plstm_keras/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2877, in rnn\n    input_ta = input_ta.unstack(inputs)', 'File "/home/nicole/anaconda3/envs/plstm_keras/lib/python3.6/site-packages/tensorflow/python/util/tf_should_use.py", line 175, in wrapped\n    return _add_should_use_warning(fn(*args, **kwargs))', 'File "/home/nicole/anaconda3/envs/plstm_keras/lib/python3.6/site-packages/tensorflow/python/ops/tensor_array_ops.py", line 413, in unstack\n    indices=math_ops.range(0, num_elements), value=value, name=name)', 'File "/home/nicole/anaconda3/envs/plstm_keras/lib/python3.6/site-packages/tensorflow/python/util/tf_should_use.py", line 175, in wrapped\n    return _add_should_use_warning(fn(*args, **kwargs))', 'File "/home/nicole/anaconda3/envs/plstm_keras/lib/python3.6/site-packages/tensorflow/python/util/tf_should_use.py", line 144, in _add_should_use_warning\n    wrapped = TFShouldUseWarningWrapper(x)', 'File "/home/nicole/anaconda3/envs/plstm_keras/lib/python3.6/site-packages/tensorflow/python/util/tf_should_use.py", line 101, in __init__\n    stack = [s.strip() for s in traceback.format_stack()]']
==================================

nicolefinnie avatar Jul 14 '18 21:07 nicolefinnie