Comments (6)
Can you paste the repro script (instead of using the attachment) and some more detailed error logs here for us to debug more easily?
from coremltools.
Conversion script:
coreml_model = coremltools.converters.keras.convert(
'yolo.h5',
input_names='image',
image_input_names='image',
output_names='grid',
image_scale=1/255.)
coreml_model.author = 'Redmon, Joseph and Farhadi, Ali'
coreml_model.license = 'Public Domain'
coreml_model.short_description = "Tiny YOLO neural network (2016), arXiv:1612.08242"
coreml_model.input_description['image'] = 'Input image'
coreml_model.output_description['grid'] = 'The 13x13 grid with the bounding box data'
print(coreml_model)
coreml_model.save('YOLO.mlmodel')
I'm using last coremtools available now (version 0.6.3). It's not possible to attach the Keras model here. So check my Google drive link in first post for the model.
Let me know if I can help with something else. Thank you.
from coremltools.
The console message indicates an error while loading the keras model. It looks like something is off while converting darknet configuration to keras model. Can you verify the validity of your Keras model?
from coremltools.
I'm new to the machine learning area so it's problematic for me to test it.
But the convertor from Darknet to Keras finished with success as with the TinyYOLO (simpler brother of YOLO). And I didn't have problem with converting TinyYOLO to mlmodel so that's why I thought the problem is in the coremltools.
from coremltools.
This looks like an issue with how the Keras model was saved. The error is happening when you are loading a Keras model from your .h5 file. I'm not sure this has to do with coremltools.
Please try the following:
coreml_model = coremltools.converters.keras.convert( keras_model, input_names='image', image_input_names='image', output_names='grid', image_scale=1/255.)
where keras_model
is the model and not the filename
from coremltools.
@srikris You were right the problem is not in coremltools but something is wrong with the converted Keras model. I will try to investigate it further. I'm closing this issue.
Simple code proved problem in the model:
from keras.models import load_model
model = load_model('yolo-voc.h5')
from coremltools.
Related Issues (20)
- 🐞RuntimeError: PyTorch convert function for op 'upsample_bicubic2d' not implemented. HOT 1
- AssertionError: Item selection is supported only on python list/tuple objects HOT 6
- [ExecuTorch] Cannot Use Bool Index HOT 1
- [ExecuTorch] Cannot Convert Empty Model
- [ExecuTorch] IndexPut Fails on NeuralNetwork Backend
- feature: open-source MPS HOT 1
- [torch.jit.trace] Inplace Index Put Silent Error
- [ExecuTorch] Cannot Use Dynamic Index to Select HOT 1
- CoreML pip package drift HOT 2
- pytorch model is transformed into coreml model expect a tensor of type integer, but actually receive a tensor of type floating point. HOT 1
- The utilization rate of GPU is only about 2% in Mac HOT 1
- Support an `aarch64` wheel HOT 4
- numpy_t model op is missing when converting a model using M.T transpose notation HOT 9
- support for torch.cdist HOT 3
- [ExecuTorch] Placeholder Assertion Error HOT 1
- OpRegistry Error when defining MIL Program HOT 1
- Quantization for mlpackage model HOT 1
- tf.random.uniform is optimized out when it shouldn't be HOT 2
- MLUpdateTask not working for HOT 1
- MFCC differences between torchaudio and CoreML HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coremltools.