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

load model error! #3

Open
aligoglos opened this issue Mar 5, 2020 · 4 comments
Open

load model error! #3

aligoglos opened this issue Mar 5, 2020 · 4 comments

Comments

@aligoglos
Copy link

I've tried test mainimprovementcolor.py but in line 158 I got this error:

tracking <tf.Variable 'batch_renormalization_2/batch_renormalization_2_r_max:0' shape=(1,) dtype=float32> r_max
tracking <tf.Variable 'batch_renormalization_2/batch_renormalization_2_d_max:0' shape=(1,) dtype=float32> d_max
tracking <tf.Variable 'batch_renormalization_2/batch_renormalization_2_t:0' shape=(1,) dtype=float32> t
tracking <tf.Variable 'batch_renormalization_3/batch_renormalization_3_r_max:0' shape=(1,) dtype=float32> r_max
tracking <tf.Variable 'batch_renormalization_3/batch_renormalization_3_d_max:0' shape=(1,) dtype=float32> d_max
tracking <tf.Variable 'batch_renormalization_3/batch_renormalization_3_t:0' shape=(1,) dtype=float32> t
tracking <tf.Variable 'batch_renormalization_4/batch_renormalization_4_r_max:0' shape=(1,) dtype=float32> r_max
tracking <tf.Variable 'batch_renormalization_4/batch_renormalization_4_d_max:0' shape=(1,) dtype=float32> d_max
tracking <tf.Variable 'batch_renormalization_4/batch_renormalization_4_t:0' shape=(1,) dtype=float32> t
tracking <tf.Variable 'batch_renormalization_5/batch_renormalization_5_r_max:0' shape=(1,) dtype=float32> r_max
tracking <tf.Variable 'batch_renormalization_5/batch_renormalization_5_d_max:0' shape=(1,) dtype=float32> d_max
tracking <tf.Variable 'batch_renormalization_5/batch_renormalization_5_t:0' shape=(1,) dtype=float32> t
tracking <tf.Variable 'batch_renormalization_17/batch_renormalization_17_r_max:0' shape=(1,) dtype=float32> r_max
tracking <tf.Variable 'batch_renormalization_17/batch_renormalization_17_d_max:0' shape=(1,) dtype=float32> d_max
tracking <tf.Variable 'batch_renormalization_17/batch_renormalization_17_t:0' shape=(1,) dtype=float32> t
tracking <tf.Variable 'batch_renormalization_6/batch_renormalization_6_r_max:0' shape=(1,) dtype=float32> r_max
tracking <tf.Variable 'batch_renormalization_6/batch_renormalization_6_d_max:0' shape=(1,) dtype=float32> d_max
tracking <tf.Variable 'batch_renormalization_6/batch_renormalization_6_t:0' shape=(1,) dtype=float32> t
tracking <tf.Variable 'batch_renormalization_7/batch_renormalization_7_r_max:0' shape=(1,) dtype=float32> r_max
tracking <tf.Variable 'batch_renormalization_7/batch_renormalization_7_d_max:0' shape=(1,) dtype=float32> d_max
tracking <tf.Variable 'batch_renormalization_7/batch_renormalization_7_t:0' shape=(1,) dtype=float32> t
tracking <tf.Variable 'batch_renormalization_8/batch_renormalization_8_r_max:0' shape=(1,) dtype=float32> r_max
tracking <tf.Variable 'batch_renormalization_8/batch_renormalization_8_d_max:0' shape=(1,) dtype=float32> d_max
tracking <tf.Variable 'batch_renormalization_8/batch_renormalization_8_t:0' shape=(1,) dtype=float32> t
tracking <tf.Variable 'batch_renormalization_9/batch_renormalization_9_r_max:0' shape=(1,) dtype=float32> r_max
tracking <tf.Variable 'batch_renormalization_9/batch_renormalization_9_d_max:0' shape=(1,) dtype=float32> d_max
tracking <tf.Variable 'batch_renormalization_9/batch_renormalization_9_t:0' shape=(1,) dtype=float32> t
tracking <tf.Variable 'batch_renormalization_10/batch_renormalization_10_r_max:0' shape=(1,) dtype=float32> r_max
tracking <tf.Variable 'batch_renormalization_10/batch_renormalization_10_d_max:0' shape=(1,) dtype=float32> d_max
tracking <tf.Variable 'batch_renormalization_10/batch_renormalization_10_t:0' shape=(1,) dtype=float32> t
tracking <tf.Variable 'batch_renormalization_11/batch_renormalization_11_r_max:0' shape=(1,) dtype=float32> r_max
tracking <tf.Variable 'batch_renormalization_11/batch_renormalization_11_d_max:0' shape=(1,) dtype=float32> d_max
tracking <tf.Variable 'batch_renormalization_11/batch_renormalization_11_t:0' shape=(1,) dtype=float32> t
tracking <tf.Variable 'batch_renormalization_18/batch_renormalization_18_r_max:0' shape=(1,) dtype=float32> r_max
tracking <tf.Variable 'batch_renormalization_18/batch_renormalization_18_d_max:0' shape=(1,) dtype=float32> d_max
tracking <tf.Variable 'batch_renormalization_18/batch_renormalization_18_t:0' shape=(1,) dtype=float32> t
tracking <tf.Variable 'batch_renormalization_12/batch_renormalization_12_r_max:0' shape=(1,) dtype=float32> r_max
tracking <tf.Variable 'batch_renormalization_12/batch_renormalization_12_d_max:0' shape=(1,) dtype=float32> d_max
tracking <tf.Variable 'batch_renormalization_12/batch_renormalization_12_t:0' shape=(1,) dtype=float32> t
tracking <tf.Variable 'batch_renormalization_13/batch_renormalization_13_r_max:0' shape=(1,) dtype=float32> r_max
tracking <tf.Variable 'batch_renormalization_13/batch_renormalization_13_d_max:0' shape=(1,) dtype=float32> d_max
tracking <tf.Variable 'batch_renormalization_13/batch_renormalization_13_t:0' shape=(1,) dtype=float32> t
tracking <tf.Variable 'batch_renormalization_14/batch_renormalization_14_r_max:0' shape=(1,) dtype=float32> r_max
tracking <tf.Variable 'batch_renormalization_14/batch_renormalization_14_d_max:0' shape=(1,) dtype=float32> d_max
tracking <tf.Variable 'batch_renormalization_14/batch_renormalization_14_t:0' shape=(1,) dtype=float32> t
tracking <tf.Variable 'batch_renormalization_15/batch_renormalization_15_r_max:0' shape=(1,) dtype=float32> r_max
tracking <tf.Variable 'batch_renormalization_15/batch_renormalization_15_d_max:0' shape=(1,) dtype=float32> d_max
tracking <tf.Variable 'batch_renormalization_15/batch_renormalization_15_t:0' shape=(1,) dtype=float32> t
tracking <tf.Variable 'batch_renormalization_16/batch_renormalization_16_r_max:0' shape=(1,) dtype=float32> r_max
tracking <tf.Variable 'batch_renormalization_16/batch_renormalization_16_d_max:0' shape=(1,) dtype=float32> d_max
tracking <tf.Variable 'batch_renormalization_16/batch_renormalization_16_t:0' shape=(1,) dtype=float32> t
tracking <tf.Variable 'batch_renormalization_19/batch_renormalization_19_r_max:0' shape=(1,) dtype=float32> r_max
tracking <tf.Variable 'batch_renormalization_19/batch_renormalization_19_d_max:0' shape=(1,) dtype=float32> d_max
tracking <tf.Variable 'batch_renormalization_19/batch_renormalization_19_t:0' shape=(1,) dtype=float32> t
Traceback (most recent call last):
  File "mainimprovementcolor.py", line 158, in <module>
    model = load_model(args.pretrain, compile=False)
  File "C:\Users\127051\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\engine\saving.py", line 492, in load_wrapper
    return load_function(*args, **kwargs)
  File "C:\Users\127051\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\engine\saving.py", line 584, in load_model
    model = _deserialize_model(h5dict, custom_objects, compile)
  File "C:\Users\127051\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\engine\saving.py", line 334, in _deserialize_model
    ' elements.')
ValueError: Layer #1 (named "batch_renormalization_1" in the current model) was found to correspond to layer b'batch_renormalization_1' in the save file. However the new layer batch_renormalization_1 expects 7 weights, but the saved weights have 4 elements.
@HaowenGuan
Copy link

Same issure

@nkoprowicz3
Copy link

I had this issue too but was able to get around it by making starting with a fresh python 2.7 environment and installing Keras 2.1.0, and Tensorflow 1.3.0.

@ansariyusuf
Copy link

@nkoprowicz3 How did you install Tensorflow 1.3.0? I am unable to locate the package on conda or pip. Please assist.

Thank you,

@hellloxiaotian
Copy link
Owner

hellloxiaotian commented Jan 14, 2021 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

5 participants