Open JakupGuven opened 5 years ago
I can add that I'm trying to convert a YOLOv3-tiny model
I used python 3.6.5 with Keras 2.1.6 tensorflow 1.5.0 coremltools 2.0 Convert with tensorflow 1.12.0 and Keras 2.2.4 will get errors like ImportError: cannot import name relu6. TypeError('Keyword argument not understood:', kwarg)
@Ma-Dan Do you use the keras-yolo3 repo to convert from Darknet to Keras? If so how does that virtualenv look?
Okay @Ma-Dan. I installed a fresh Python 3.6.5 from here: https://www.python.org/downloads/release/python-365/
You can see in the image I attach that I have the versions of tensorflow, keras and coremltools that you specified.
I created a virtualenv and installed dependencies with correct versions and I get this error message:
Traceback (most recent call last):
File "coreml.py", line 3, in
I used this https://github.com/qqwweee/keras-yolo3 to convert my model trained using Darknet to a Keras model. I'm trying to convert it to CoreML but get errors. I think it would be very good if you could specify how your virtualenv looks like when you do this @Ma-Dan
The error I get:
tf.estimator package not installed. tf.estimator package not installed. Traceback (most recent call last): File "coreml.py", line 3, in
coreml_model = coremltools.converters.keras.convert('Doors.h5', input_names='input1', image_input_names='input1', output_names=['output1', 'output2', 'output3'], image_scale=1/255.)
File "/home/jakup/Utilities/coreml/local/lib/python2.7/site-packages/coremltools/converters/keras/_keras_converter.py", line 760, in convert
custom_conversion_functions=custom_conversion_functions)
File "/home/jakup/Utilities/coreml/local/lib/python2.7/site-packages/coremltools/converters/keras/_keras_converter.py", line 537, in convertToSpec
custom_objects=custom_objects)
File "/home/jakup/Utilities/coreml/local/lib/python2.7/site-packages/coremltools/converters/keras/_keras_converter.py", line 168, in _convert
model = _keras.models.load_model(model, custom_objects = custom_objects)
File "/home/jakup/Utilities/coreml/local/lib/python2.7/site-packages/keras/models.py", line 142, in load_model
model = model_from_config(model_config, custom_objects=custom_objects)
File "/home/jakup/Utilities/coreml/local/lib/python2.7/site-packages/keras/models.py", line 193, in model_from_config
return layer_from_config(config, custom_objects=custom_objects)
File "/home/jakup/Utilities/coreml/local/lib/python2.7/site-packages/keras/utils/layer_utils.py", line 40, in layer_from_config
custom_objects=custom_objects)
File "/home/jakup/Utilities/coreml/local/lib/python2.7/site-packages/keras/engine/topology.py", line 2582, in from_config
process_layer(layer_data)
File "/home/jakup/Utilities/coreml/local/lib/python2.7/site-packages/keras/engine/topology.py", line 2560, in process_layer
custom_objects=custom_objects)
File "/home/jakup/Utilities/coreml/local/lib/python2.7/site-packages/keras/utils/layer_utils.py", line 42, in layer_from_config
return layer_class.from_config(config['config'])
File "/home/jakup/Utilities/coreml/local/lib/python2.7/site-packages/keras/engine/topology.py", line 1025, in from_config
return cls(**config)
TypeError: init() got an unexpected keyword argument 'dtype'