Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Muhammad-Zubair opened this issue Dec 20, 2020 · 1 comment

Comments

@Muhammad-Zubair
Copy link

Muhammad-Zubair commented Dec 20, 2020

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)

@karynaur
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants