ashnkumar / sketch-code

Keras model to generate HTML code from hand-drawn website mockups. Implements an image captioning architecture to drawn source images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Muhammad-Zubair opened this issue · 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)

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