keras-resnet icon indicating copy to clipboard operation
keras-resnet copied to clipboard

error 1d load model

Open andresdigiovanni opened this issue 4 years ago • 2 comments

When load a model

` # save model model_json = model.to_json() with open("model.json", "w") as json_file: json_file.write(model_json)

# load json and create model
json_file = open('model.json', 'r')
loaded_model_json = json_file.read()
json_file.close()
model = model_from_json(loaded_model_json, custom_objects={
    'ResNet1D18': keras_resnet.models.ResNet1D18,
    'BatchNormalization': keras_resnet.layers.BatchNormalization })

`

I get this error:

Shape must be rank 3 but is rank 4 for 'padding_conv1_2/Pad'

andresdigiovanni avatar Mar 09 '20 11:03 andresdigiovanni

mee too bro, need help!

liuanhua110 avatar Aug 05 '20 07:08 liuanhua110

I tried implementing your fixes @tackoo for my data of 1600 rows 103 columns. I've tried training the data earlier with Conv1D in a sequential model with input (103,1) but when I try to use this inpus shape for this ResNet model I get this error: ValueError: Input 0 of layer conv1 is incompatible with the layer: : expected min_ndim=4, found ndim=3. Full shape received: (None, 103, 1)

aadnesd avatar Apr 15 '21 12:04 aadnesd