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

Exception: Weight count mismatch for layer #20 (named time_distributed_1). Layer expects 2 weight(s). Received 0 saved weight(s) #46

Open
giorgio-denunzio opened this issue Sep 20, 2023 · 7 comments

Comments

@giorgio-denunzio
Copy link

Hello and thanks for this software!

I could not easily install it simply by the requirements file, but I had to struggle some hours, finally getting it to work (almost).

In the working configuration I am using python 3.9 (no chance with 3.7 and 3.8, or 3.10 and 3.11) in miniconda, ubuntu 20.04 in wsl2.
After installing python, I used the requirements file but I had then to:

  1. make some installations manually (details available, of course, if someone is interested)
  2. change in cnn.py:
    #from keras.engine.topology import get_source_inputs
    from keras.utils.layer_utils import get_source_inputs

Now the GUI starts.

I can:

  • go to the "recognize flowchart" menu,
  • select the "9" folder for the traning results,
  • load an input image,
  • click on "predict"

but I get:

Using Conda env: handwritten-flowchart-recog
Config loaded successful!!
Loading weights from model/training_results/9/flowchart_3b_model.hdf5
Exception: Weight count mismatch for layer #20 (named time_distributed_1). Layer expects 2 weight(s). Received 0 saved weight(s)
Couldn't load pretrained model weights!

What may the problem be? Too tired now to try anything myself...
Thanks!
Best
Giorgio

@giorgio-denunzio
Copy link
Author

Is it possible that the format of the trained network, saved into flowchart_3b_model.hdf5, has changed with time so that it is no more compatible with newer software?

@giorgio-denunzio
Copy link
Author

giorgio-denunzio commented Sep 22, 2023

Just to give complete information, I retried on another pc, and python 3.7 worked. Everything else I wrote in the preceding messages remains true: I still have:

Loading weights from model/training_results/9/flowchart_3b_model.hdf5
Exception: Weight count mismatch for layer #20 (named time_distributed_1). Layer expects 2 weight(s). Received 0 saved weight(s)
Couldn't load pretrained model weights!

@fzy1999
Copy link

fzy1999 commented Nov 19, 2023

I meet the same question . do you have solve it? thank you very much

@giorgio-denunzio
Copy link
Author

No, sorry.... :-(

@fzy1999
Copy link

fzy1999 commented Nov 26, 2023 via email

@dbetm
Copy link
Owner

dbetm commented Dec 20, 2023

Is it possible that the format of the trained network, saved into flowchart_3b_model.hdf5, has changed with time so that it is no more compatible with newer software?

Hello,

No, it hasn't changed, I will check this issue

@fzy1999
Copy link

fzy1999 commented Dec 20, 2023 via email

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

3 participants