Giter Club home page Giter Club logo

Comments (6)

srikris avatar srikris commented on May 18, 2024

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.

pcmanik avatar pcmanik commented on May 18, 2024

Full output from console:
snimka obrazovky 2017-10-12 o 20 12 33

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')

Structure of YOLO network
yolo

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.

slin07 avatar slin07 commented on May 18, 2024

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.

pcmanik avatar pcmanik commented on May 18, 2024

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.

srikris avatar srikris commented on May 18, 2024

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.

pcmanik avatar pcmanik commented on May 18, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.