sketch-code icon indicating copy to clipboard operation
sketch-code copied to clipboard

ValueError: GRU(reset_after=False) is not compatible with GRU(reset_after=True)

Open Muhammad-Zubair opened this issue 5 years ago • 1 comments

This Error occurred when try to execute even on example png file included in examples folder:-

Traceback (most recent call last): File "convert_single_image.py", line 53, in main() File "convert_single_image.py", line 49, in main model_weights_path = model_weights_file) File "/content/drive/My Drive/testp2c/sketch-code/src/classes/inference/Sampler.py", line 23, in init self.model = self.load_model(model_json_path, model_weights_path) File "/content/drive/My Drive/testp2c/sketch-code/src/classes/inference/Sampler.py", line 74, in load_model loaded_model.load_weights(model_weights_path) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py", line 2234, in load_weights hdf5_format.load_weights_from_hdf5_group(f, self.layers) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/saving/hdf5_format.py", line 700, in load_weights_from_hdf5_group layer, weight_values, original_keras_version, original_backend) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/saving/hdf5_format.py", line 410, in preprocess_weights_for_loading return _convert_rnn_weights(layer, weights) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/saving/hdf5_format.py", line 571, in _convert_rnn_weights raise ValueError('%s is not compatible with %s' % types) ValueError: GRU(reset_after=False) is not compatible with GRU(reset_after=True)

Muhammad-Zubair avatar Dec 20 '20 13:12 Muhammad-Zubair

pip install -r requirements.txt should remove the error. The code is written in tensorflow 1.x while you are trying to run it on tensorflow 2.x

karynaur avatar Apr 16 '21 16:04 karynaur