mvoelk/ssd_detectors

SL_end2end_predict.ipynb: Model dimensions don't match that in weights file.

anindya7 opened this issue · 4 comments

In notebook SL_end2end_predict.ipynb:

Model = SL512 weights_path = './models/201809231008_sl512_synthtext/weights.002.h5' segment_threshold = 0.6; link_threshold = 0.25 plot_name = 'sl512_crnn_sythtext' Model = DSODSL512 weights_path = './models/201806021007_dsodsl512_synthtext/weights.012.h5' segment_threshold = 0.55; link_threshold = 0.45 plot_name = 'dsodsl512_crnn_sythtext' sl_graph = tf.Graph() with sl_graph.as_default(): sl_session = tf.compat.v1.Session() with sl_session.as_default(): model = Model() prior_util = PriorUtil(model) load_weights(model, weights_path) image_size = model.image_size

Gives output:

WARNING:tensorflow:From /usr/local/lib/python3.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1635: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version. Instructions for updating: If using Keras pass *_constraint arguments to layers. something went wrong conv2d_1 model [[3, 3, 64, 64], [64]] file [(3, 3, 3, 64), (64,)] Layer weight shape (3, 3, 64, 64) not compatible with provided weight shape (3, 3, 3, 64) something went wrong conv2d_2 model [[3, 3, 64, 128], [128]] file [(3, 3, 64, 64), (64,)] Layer weight shape (3, 3, 64, 128) not compatible with provided weight shape (3, 3, 64, 64) something went wrong batch_normalization_2 model [[128], [128], [128], [128]] file [(64,), (64,), (64,), (64,)] Layer weight shape (128,) not compatible with provided weight shape (64,) something went wrong conv2d_3 model [[1, 1, 128, 192], [192]] file [(3, 3, 64, 128), (128,)] Layer weight shape (1, 1, 128, 192) not compatible with provided weight shape (3, 3, 64, 128) something went wrong batch_normalization_4 model [[192], [192], [192], [192]] file [(128,), (128,), (128,), (128,)] Layer weight shape (192,) not compatible with provided weight shape (128,) something went wrong conv2d_4 model [[3, 3, 192, 48], [48]] file [(1, 1, 128, 192), (192,)] Layer weight shape (3, 3, 192, 48) not compatible with provided weight shape (1, 1, 128, 192) something went wrong batch_normalization_5 model [[176], [176], [176], [176]] file [(192,), (192,), (192,), (192,)] Layer weight shape (176,) not compatible with provided weight shape (192,) something went wrong conv2d_5 model [[1, 1, 176, 192], [192]] file [(3, 3, 192, 48), (48,)] Layer weight shape (1, 1, 176, 192) not compatible with provided weight shape (3, 3, 192, 48) something went wrong batch_normalization_6 model [[192], [192], [192], [192]] file [(176,), (176,), (176,), (176,)] Layer weight shape (192,) not compatible with provided weight shape (176,) something went wrong conv2d_6 model [[3, 3, 192, 48], [48]] file [(1, 1, 176, 192), (192,)] Layer weight shape (3, 3, 192, 48) not compatible with provided weight shape (1, 1, 176, 192) something went wrong batch_normalization_7 model [[224], [224], [224], [224]] file [(192,), (192,), (192,), (192,)] Layer weight shape (224,) not compatible with provided weight shape (192,) something went wrong conv2d_7 model [[1, 1, 224, 192], [192]] file [(3, 3, 192, 48), (48,)] Layer weight shape (1, 1, 224, 192) not compatible with provided weight shape (3, 3, 192, 48) something went wrong batch_normalization_8 model [[192], [192], [192], [192]] file [(224,), (224,), (224,), (224,)] Layer weight shape (192,) not compatible with provided weight shape (224,) something went wrong conv2d_8 model [[3, 3, 192, 48], [48]] file [(1, 1, 224, 192), (192,)] Layer weight shape (3, 3, 192, 48) not compatible with provided weight shape (1, 1, 224, 192) something went wrong batch_normalization_9 model [[272], [272], [272], [272]] file [(192,), (192,), (192,), (192,)] Layer weight shape (272,) not compatible with provided weight shape (192,) something went wrong conv2d_9 model [[1, 1, 272, 192], [192]] file [(3, 3, 192, 48), (48,)] Layer weight shape (1, 1, 272, 192) not compatible with provided weight shape (3, 3, 192, 48) something went wrong batch_normalization_10 model [[192], [192], [192], [192]] file [(272,), (272,), (272,), (272,)] Layer weight shape (192,) not compatible with provided weight shape (272,) something went wrong conv2d_10 model [[3, 3, 192, 48], [48]] file [(1, 1, 272, 192), (192,)] Layer weight shape (3, 3, 192, 48) not compatible with provided weight shape (1, 1, 272, 192) something went wrong batch_normalization_11 model [[320], [320], [320], [320]] file [(192,), (192,), (192,), (192,)] Layer weight shape (320,) not compatible with provided weight shape (192,) something went wrong conv2d_11 model [[1, 1, 320, 192], [192]] file [(3, 3, 192, 48), (48,)] Layer weight shape (1, 1, 320, 192) not compatible with provided weight shape (3, 3, 192, 48) something went wrong batch_normalization_12 model [[192], [192], [192], [192]] file [(320,), (320,), (320,), (320,)] Layer weight shape (192,) not compatible with provided weight shape (320,) something went wrong conv2d_12 model [[3, 3, 192, 48], [48]] file [(1, 1, 320, 192), (192,)] Layer weight shape (3, 3, 192, 48) not compatible with provided weight shape (1, 1, 320, 192) something went wrong batch_normalization_13 model [[368], [368], [368], [368]] file [(192,), (192,), (192,), (192,)] Layer weight shape (368,) not compatible with provided weight shape (192,) something went wrong conv2d_13 model [[1, 1, 368, 192], [192]] file [(3, 3, 192, 48), (48,)] Layer weight shape (1, 1, 368, 192) not compatible with provided weight shape (3, 3, 192, 48) something went wrong batch_normalization_14 model [[192], [192], [192], [192]] file [(368,), (368,), (368,), (368,)] Layer weight shape (192,) not compatible with provided weight shape (368,) something went wrong conv2d_14 model [[3, 3, 192, 48], [48]] file [(1, 1, 368, 192), (192,)] Layer weight shape (3, 3, 192, 48) not compatible with provided weight shape (1, 1, 368, 192) something went wrong batch_normalization_15 model [[416], [416], [416], [416]] file [(192,), (192,), (192,), (192,)] Layer weight shape (416,) not compatible with provided weight shape (192,) something went wrong conv2d_15 model [[1, 1, 416, 416], [416]] file [(3, 3, 192, 48), (48,)] Layer weight shape (1, 1, 416, 416) not compatible with provided weight shape (3, 3, 192, 48) something went wrong conv2d_16 model [[1, 1, 416, 192], [192]] file [(1, 1, 416, 416), (416,)] Layer weight shape (1, 1, 416, 192) not compatible with provided weight shape (1, 1, 416, 416) something went wrong batch_normalization_17 model [[192], [192], [192], [192]] file [(416,), (416,), (416,), (416,)] Layer weight shape (192,) not compatible with provided weight shape (416,) something went wrong conv2d_17 model [[3, 3, 192, 48], [48]] file [(1, 1, 416, 192), (192,)] Layer weight shape (3, 3, 192, 48) not compatible with provided weight shape (1, 1, 416, 192) something went wrong batch_normalization_18 model [[464], [464], [464], [464]] file [(192,), (192,), (192,), (192,)] Layer weight shape (464,) not compatible with provided weight shape (192,) something went wrong conv2d_18 model [[1, 1, 464, 192], [192]] file [(3, 3, 192, 48), (48,)] Layer weight shape (1, 1, 464, 192) not compatible with provided weight shape (3, 3, 192, 48) something went wrong batch_normalization_19 model [[192], [192], [192], [192]] file [(464,), (464,), (464,), (464,)] Layer weight shape (192,) not compatible with provided weight shape (464,) something went wrong conv2d_19 model [[3, 3, 192, 48], [48]] file [(1, 1, 464, 192), (192,)] Layer weight shape (3, 3, 192, 48) not compatible with provided weight shape (1, 1, 464, 192) something went wrong batch_normalization_20 model [[512], [512], [512], [512]] file [(192,), (192,), (192,), (192,)] Layer weight shape (512,) not compatible with provided weight shape (192,) something went wrong conv2d_20 model [[1, 1, 512, 192], [192]] file [(3, 3, 192, 48), (48,)] Layer weight shape (1, 1, 512, 192) not compatible with provided weight shape (3, 3, 192, 48) something went wrong batch_normalization_21 model [[192], [192], [192], [192]] file [(512,), (512,), (512,), (512,)] Layer weight shape (192,) not compatible with provided weight shape (512,) something went wrong conv2d_21 model [[3, 3, 192, 48], [48]] file [(1, 1, 512, 192), (192,)] Layer weight shape (3, 3, 192, 48) not compatible with provided weight shape (1, 1, 512, 192) something went wrong batch_normalization_22 model [[560], [560], [560], [560]] file [(192,), (192,), (192,), (192,)] Layer weight shape (560,) not compatible with provided weight shape (192,) something went wrong conv2d_22 model [[1, 1, 560, 192], [192]] file [(3, 3, 192, 48), (48,)] Layer weight shape (1, 1, 560, 192) not compatible with provided weight shape (3, 3, 192, 48) something went wrong batch_normalization_23 model [[192], [192], [192], [192]] file [(560,), (560,), (560,), (560,)] Layer weight shape (192,) not compatible with provided weight shape (560,) something went wrong conv2d_23 model [[3, 3, 192, 48], [48]] file [(1, 1, 560, 192), (192,)] Layer weight shape (3, 3, 192, 48) not compatible with provided weight shape (1, 1, 560, 192) something went wrong batch_normalization_24 model [[608], [608], [608], [608]] file [(192,), (192,), (192,), (192,)].....

and so on.

Environment: tensorflow 2.2.0

Please let me know why this is happening and what I could to to solve it.

It should be fixed now, but I haven't tested *_end2end_videotest.py. Can you confirm?

Sure, will do. Please email me a list of fixes and pointers on documentation notes on anindyachanda7@gmail.com and I can contribute to this repo. I believe many users can benefit from the code here with just a brief guide on usage.

Yes, I should add more documentation to the repo, as soon as I find the time. I prefer the issues because I don't want to answer the same questions again and again. Pull requests are welcome...