uctb / UCTB

An Open Source Spatio-Temporal Prediction Package
MIT License
180 stars 42 forks source link

'GCLSTMCell' object has no attribute '_compute_carry_and_output_fused' #7

Closed Star-live closed 3 years ago

Star-live commented 3 years ago

When I run this file https://github.com/uctb/UCTB/blob/master/QuickStarts/STMeta.py, the program shows the following error:

Traceback (most recent call last):
  File "/home/zhuhang/program/anaconda3/envs/py36tensor1/lib/python3.6/contextlib.py", line 99, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/zhuhang/program/anaconda3/envs/py36tensor1/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 5229, in get_controller
    yield g
  File "/home/zhuhang/program/anaconda3/envs/py36tensor1/lib/python3.6/site-packages/UCTB/model/STMeta.py", line 164, in build
    outputs = tf.keras.layers.RNN(multi_layer_cell)(tf.reshape(target_tensor, [-1, time_step, 1]))
  File "/home/zhuhang/program/anaconda3/envs/py36tensor1/lib/python3.6/site-packages/tensorflow/python/keras/layers/recurrent.py", line 619, in __call__
    return super(RNN, self).__call__(inputs, **kwargs)
  File "/home/zhuhang/program/anaconda3/envs/py36tensor1/lib/python3.6/site-packages/tensorflow/python/keras/engine/base_layer.py", line 757, in __call__
    outputs = self.call(inputs, *args, **kwargs)
  File "/home/zhuhang/program/anaconda3/envs/py36tensor1/lib/python3.6/site-packages/tensorflow/python/keras/layers/recurrent.py", line 750, in call
    input_length=timesteps)
  File "/home/zhuhang/program/anaconda3/envs/py36tensor1/lib/python3.6/site-packages/tensorflow/python/keras/backend.py", line 3201, in rnn
    outputs, _ = step_function(inputs[0], initial_states + constants)
  File "/home/zhuhang/program/anaconda3/envs/py36tensor1/lib/python3.6/site-packages/tensorflow/python/keras/layers/recurrent.py", line 737, in step
    output, new_states = self.cell.call(inputs, states, **kwargs)
  File "/home/zhuhang/program/anaconda3/envs/py36tensor1/lib/python3.6/site-packages/tensorflow/python/keras/layers/recurrent.py", line 147, in call
    inputs, states = cell.call(inputs, states, **kwargs)
  File "/home/zhuhang/program/anaconda3/envs/py36tensor1/lib/python3.6/site-packages/UCTB/model_unit/ST_RNN.py", line 136, in call
    c, o = self._compute_carry_and_output_fused(z, c_tm1)
AttributeError: 'GCLSTMCell' object has no attribute '_compute_carry_and_output_fused'

I am sure that the UTCB I installed is correct, and the data can be loaded normally, because I can run the following file normally https://github.com/uctb/UCTB/blob/master/QuickStarts/Visualization.py.

Excuse me, how should I modify it so that it can be used normally?

Liyue-Chen commented 3 years ago

Hi~

I test the STMeta model in QuickStart and it works. Maybe your TensorFlow or Keras version is not compatible with UCTB.

We highly recommend the following dependencies:

Thanks for your attention.

Star-live commented 3 years ago

Thanks for your reply. When I upgrader tensorflow from 1.12.0 to 1.13.1. This question is resolved.