Hi All, I am trying to train a model with Resnet50 class that is given in part-1. But, running into issue.
Training code :
resnet = Resnet50()
batches = resnet.get_batches(path+‘train’, batch_size=batch_size)
val_batches = resnet.get_batches(path+‘val’, batch_size=batch_size*2)
resnet.finetune(batches)
resnet.fit(batches, val_batches, nb_epoch=5)
Save :
resnet.model.save(‘resent50.h5’)
Convert to CoreML :
coreml_model = coremltools.converters.keras.convert( ‘resent50.h5’,
image_input_names=‘data’,
class_labels=‘labels.txt’)
coreml_model.save(‘resent50.mlmodel’)
Error :
138 model_config = f.attrs.get('model_config')
139 if model_config is None:
–> 140 raise ValueError(‘No model found in config file.’)
141 model_config = json.loads(model_config.decode(‘utf-8’))
142 model = model_from_config(model_config, custom_objects=custom_objects)
ValueError: No model found in config file.
----------->
Then I tried to load the model directly using keras, and I get a error there as well
model = keras.models.load_model(‘resent50.h5’)
/home/ubuntu/anaconda2/lib/python2.7/site-packages/keras/utils/generic_utils.pyc in get_from_module(identifier, module_params, module_name, instantiate, kwargs)
123 if not res:
124 raise ValueError('Invalid ’ + str(module_name) + ': ’ +
–> 125 str(identifier))
126 if instantiate and not kwargs:
127 return res()
ValueError: Invalid core: vgg_preprocess
As anyone done conversion to CoreML successfully ?