AIWintermuteAI / aXeleRate

Keras-based framework for AI on the Edge
MIT License
177 stars 71 forks source link

No output or errors from yolo model on K210 board despite being able to run on the PC #35

Closed vjsyong closed 3 years ago

vjsyong commented 3 years ago

Describe the bug No output on Maix bit board when attempting to perform inference on yolo detector model trained with Axelerate scripts. There are no outputs or errors both on the screen and when printing via the serial terminal

To Reproduce Steps to reproduce the behavior:

  1. Train 52 classes with the yolo detector script
  2. Flash kmodel file onto board
  3. Use k210_detector sample script as base and change labels to classes used
  4. Run inference

Expected behavior The board should output results to the screen or terminal, however there is no output or error whatsoever. The model works on my pc when I call the setup_inference() function.

Screenshots If applicable, add screenshots to help explain your problem.

Serialoutput inference

Environment (please complete the following information):

Additional context I'm trying to train a playing card detection model, as such I am teaching the model to recognise the corner of the cards where it contains both the suit and number of the card. A standard deck of playing cards has 52 classes and as such I require 52 classes for this model. This model is trained on a synthethic dataset consisting of 100k images with an average of 2.5 cards per image for a total average of 4.5k samples per class.

For additional context, I trained a proof of concept model using only 4 cards namely ["As", "3h", "8c", "Jd"] and it worked without any issues. But once I expanded training to include all 52 cards, the model fails to work on my board.

AIWintermuteAI commented 3 years ago

Hi there! Well, first of all, I do not think that you can achieve acceptable results with 52 classes... A better way would be to use 2 stage inference, similar to face recognition or license plate identification.

Now, for your issue - the fact that it works during inference in Colab and doesn't work on K210 points that there is a problem with K210 implementation of YOLO v2 detection parser. You can have a look at the source code here https://github.com/sipeed/MaixPy/blob/20c776d8f13b50309af0af7f4fe47920d64e844a/components/micropython/port/src/Maix/Maix_kpu.c#L884 and see if there are any hard limitations. Other than that, I can advise you to post this issue to MaixPy issues.

AIWintermuteAI commented 3 years ago

Hi! Have you solved the problem? I'll be closing the issue due to inactivity in 7 days, if you resolved the issue by yourself.