broadinstitute / keras-resnet

Keras package for deep residual networks
Other
300 stars 127 forks source link

error 1d load model #61

Open andresdigiovanni opened 4 years ago

andresdigiovanni commented 4 years ago

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_conv12/Pad'

liuanhua110 commented 4 years ago

mee too bro, need help!

aadnesd commented 3 years ago

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)