raw-audio-gender-classification
raw-audio-gender-classification copied to clipboard
TypeError: __init__() got multiple values for keyword argument 'data_format' (pretrained model)
'Loading and Visualisation Pretrained model" model_path= '../models/n_seconds/siamese__nseconds_3.0__filters_32__embed_64__drop_0.05__r_0.hdf5' downsampling = 4
siamese = load_model(model_path)
********************************************error
TypeError Traceback (most recent call last)
/opt/conda/lib/python3.6/site-packages/keras/models.py in load_model(filepath, custom_objects, compile) 237 raise ValueError('No model found in config file.') 238 model_config = json.loads(model_config.decode('utf-8')) --> 239 model = model_from_config(model_config, custom_objects=custom_objects) 240 241 # set weights
/opt/conda/lib/python3.6/site-packages/keras/models.py in model_from_config(config, custom_objects)
311 'Maybe you meant to use '
312 'Sequential.from_config(config)
?')
--> 313 return layer_module.deserialize(config, custom_objects=custom_objects)
314
315
/opt/conda/lib/python3.6/site-packages/keras/layers/init.py in deserialize(config, custom_objects) 52 module_objects=globs, 53 custom_objects=custom_objects, ---> 54 printable_module_name='layer')
/opt/conda/lib/python3.6/site-packages/keras/utils/generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name) 137 return cls.from_config(config['config'], 138 custom_objects=dict(list(_GLOBAL_CUSTOM_OBJECTS.items()) + --> 139 list(custom_objects.items()))) 140 with CustomObjectScope(custom_objects): 141 return cls.from_config(config['config'])
/opt/conda/lib/python3.6/site-packages/keras/engine/topology.py in from_config(cls, config, custom_objects) 2485 # First, we create all layers and enqueue nodes to be processed 2486 for layer_data in config['layers']: -> 2487 process_layer(layer_data) 2488 # Then we process nodes in order of layer depth. 2489 # Nodes that cannot yet be processed (if the inbound node
/opt/conda/lib/python3.6/site-packages/keras/engine/topology.py in process_layer(layer_data) 2471 2472 layer = deserialize_layer(layer_data, -> 2473 custom_objects=custom_objects) 2474 created_layers[layer_name] = layer 2475
/opt/conda/lib/python3.6/site-packages/keras/layers/init.py in deserialize(config, custom_objects) 52 module_objects=globs, 53 custom_objects=custom_objects, ---> 54 printable_module_name='layer')
/opt/conda/lib/python3.6/site-packages/keras/utils/generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name) 137 return cls.from_config(config['config'], 138 custom_objects=dict(list(_GLOBAL_CUSTOM_OBJECTS.items()) + --> 139 list(custom_objects.items()))) 140 with CustomObjectScope(custom_objects): 141 return cls.from_config(config['config'])
/opt/conda/lib/python3.6/site-packages/keras/models.py in from_config(cls, config, custom_objects) 1211 model = cls() 1212 for conf in config: -> 1213 layer = layer_module.deserialize(conf, custom_objects=custom_objects) 1214 model.add(layer) 1215 return model
/opt/conda/lib/python3.6/site-packages/keras/layers/init.py in deserialize(config, custom_objects) 52 module_objects=globs, 53 custom_objects=custom_objects, ---> 54 printable_module_name='layer')
/opt/conda/lib/python3.6/site-packages/keras/utils/generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name)
139 list(custom_objects.items())))
140 with CustomObjectScope(custom_objects):
--> 141 return cls.from_config(config['config'])
142 else:
143 # Then cls
may be a function returning a class.
/opt/conda/lib/python3.6/site-packages/keras/engine/topology.py in from_config(cls, config) 1250 A layer instance. 1251 """ -> 1252 return cls(**config) 1253 1254 def count_params(self):
/opt/conda/lib/python3.6/site-packages/keras/legacy/interfaces.py in wrapper(*args, **kwargs)
85 warnings.warn('Update your ' + object_name + 86 '
call to the Keras 2 API: ' + signature, stacklevel=2)
---> 87 return func(*args, **kwargs)
88 wrapper._original_function = func
89 return wrapper
/opt/conda/lib/python3.6/site-packages/keras/layers/convolutional.py in init(self, filters, kernel_size, strides, padding, dilation_rate, activation, use_bias, kernel_initializer, bias_initializer, kernel_regularizer, bias_regularizer, activity_regularizer, kernel_constraint, bias_constraint, **kwargs) 331 kernel_constraint=kernel_constraint, 332 bias_constraint=bias_constraint, --> 333 **kwargs) 334 self.input_spec = InputSpec(ndim=3) 335
TypeError: init() got multiple values for keyword argument 'data_format'