01 January 1970 1 4K Report

I have trained a neural net using the below architecture using Keras:

Layer (type) Output Shape Param #

=================================================================

dense_1 (Dense) (None, 12) 108

_________________________________________________________________

dense_2 (Dense) (None, 8) 104

_________________________________________________________________

dense_3 (Dense) (None, 1) 9

=================================================================

Total params: 221

Trainable params: 221

Non-trainable params: 0

_________________________________________________________________

Also, I have saved its weights. Now I want to load its weights onto another neural net which is of the following architecture:

Layer (type) Output Shape Param #

=================================================================

dense_13 (Dense) (None, 10) 90

_________________________________________________________________

dense_14 (Dense) (None, 7) 77

_________________________________________________________________

dense_15 (Dense) (None, 1) 8

=================================================================

Total params: 175

Trainable params: 8

Non-trainable params: 167

_________________________________________________________________

I have investigated the weight arrays of both the nets and but to my wonder, they are turning out to be of the same shape. However, I am not able to load the weights as I mentioned earlier and getting the following error as obvious:

Layer weight shape (7, 10) not compatible with provided weight shape (8, 12)

Any ideas on this would be helpful.

More Sayak Paul's questions See All
Similar questions and discussions