Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: __init__() got an unexpected keyword argument 'dtype' #59

Open
wiamadaya opened this issue Aug 25, 2019 · 3 comments
Open

TypeError: __init__() got an unexpected keyword argument 'dtype' #59

wiamadaya opened this issue Aug 25, 2019 · 3 comments

Comments

@wiamadaya
Copy link

wiamadaya commented Aug 25, 2019

i trained a 1 class tiny yolo model on a custom dataset (https://github.com/experiencor/kangaroo) using this repo https://github.com/experiencor/keras-yolo2 and received the following error when performing coreml conversion

TypeError: __init__() got an unexpected keyword argument 'dtype'

@hollance
Copy link
Owner

What line number and in which file does that error occur?

@wiamadaya
Copy link
Author

wiamadaya commented Aug 26, 2019

@hollance

(coreml) (base) Wiamas-MacBook-Air:Convert user$ python coreml.py WARNING: Logging before flag parsing goes to stderr. W0826 20:13:05.465229 4428912064 __init__.py:118] TensorFlow version 1.14.0 detected. Last version known to be fully compatible is 1.12.0 . Traceback (most recent call last): File "coreml.py", line 7, in <module> coreml_model = coremltools.converters.keras.convert('yad2k/model_data/tiny_yolo_kangaroo.h5', image_input_names='image', image_scale=1/255.) File "/Users/user/coreml/lib/python2.7/site-packages/coremltools/converters/keras/_keras_converter.py", line 760, in convert custom_conversion_functions=custom_conversion_functions) File "/Users/user/coreml/lib/python2.7/site-packages/coremltools/converters/keras/_keras_converter.py", line 537, in convertToSpec custom_objects=custom_objects) File "/Users/user/coreml/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 "/Users/user/coreml/lib/python2.7/site-packages/keras/models.py", line 142, in load_model model = model_from_config(model_config, custom_objects=custom_objects) File "/Users/user/coreml/lib/python2.7/site-packages/keras/models.py", line 193, in model_from_config return layer_from_config(config, custom_objects=custom_objects) File "/Users/user/coreml/lib/python2.7/site-packages/keras/utils/layer_utils.py", line 40, in layer_from_config custom_objects=custom_objects) File "/Users/user/coreml/lib/python2.7/site-packages/keras/engine/topology.py", line 2582, in from_config process_layer(layer_data) File "/Users/user/coreml/lib/python2.7/site-packages/keras/engine/topology.py", line 2560, in process_layer custom_objects=custom_objects) File "/Users/user/coreml/lib/python2.7/site-packages/keras/utils/layer_utils.py", line 42, in layer_from_config return layer_class.from_config(config['config']) File "/Users/user/coreml/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'

i converted the sample tiny-yolo-voc.h5 to coreml without issue, so the problem should be on my custom model, or should i use this repo to train my custom model instead https://github.com/thtrieu/darkflow

@hollance
Copy link
Owner

This sounds like you're using an incompatible version of Keras. Unfortunately, Keras changes a lot between one version and the next. Since this is a relatively old repo, I'd suggest updating the yad2k package that is inside it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants