handwritten-flowchart-with-cnn icon indicating copy to clipboard operation
handwritten-flowchart-with-cnn copied to clipboard

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

Open giorgio-denunzio opened this issue 2 years ago • 7 comments

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 avatar Sep 20 '23 19:09 giorgio-denunzio

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 avatar Sep 22 '23 09:09 giorgio-denunzio

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!

giorgio-denunzio avatar Sep 22 '23 10:09 giorgio-denunzio

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

fzy1999 avatar Nov 19 '23 12:11 fzy1999

No, sorry.... :-(

giorgio-denunzio avatar Nov 26 '23 19:11 giorgio-denunzio

我已经收到你的邮件

fzy1999 avatar Nov 26 '23 19:11 fzy1999

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

dbetm avatar Dec 20 '23 04:12 dbetm

我已经收到你的邮件

fzy1999 avatar Dec 20 '23 04:12 fzy1999