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

CMSIS-NN CIFAR10 example for STM32F746G-DISCO does not work? #16

Closed
marcin-ch opened this issue Apr 29, 2019 · 25 comments
Closed

CMSIS-NN CIFAR10 example for STM32F746G-DISCO does not work? #16

marcin-ch opened this issue Apr 29, 2019 · 25 comments

Comments

@marcin-ch
Copy link

Hello All,

I am following this Image recognition on Arm Cortex-M with CMSIS-NN guide

I have exactly the same hardware:

STM32F746G-DISCO
STM32F4DIS-CAM

the same software installed

Ubuntu 16.04 LTS
Python 2.7.12
Caffe
GNU Tools for Arm Embedded Processors 7-2017-q4-major

and I am able to reproduce all mentioned in the guide steps (including building basic camera app, quantizing the model, converting the model), except the final one! = Deploy transformed model on an Arm Cortex-M processor

The final call is:

#Run this command in cmsisnn_demo folder
mbed compile -m DISCO_F746NG -t GCC_ARM --source . --source ../ML-examples/cmsisnn-cifar10/code/m7 --source ../ML-examples/cmsisnn-cifar10/camera_demo/camera_with_nn/ --source ../CMSIS_5/CMSIS/NN/Include --source ../CMSIS_5/CMSIS/NN/Source --source ../CMSIS_5/CMSIS/DSP/Include --source ../CMSIS_5/CMSIS/DSP/Source --source ../CMSIS_5/CMSIS/Core/Include -j8

The only difference is in

--source ../ML-examples/cmsisnn-cifar10/camera_demo/camera_with_nn/

the original call refers to

--source ../ML-examples/cmsisnn-cifar10/camera_demo/camera_app/

But I have not changed camera_app folder, just used already prepared by ARM folder with camera_with_nn (ARM provides ready-to-go camera apps without NN and with NN, here)

And mbed finishes with info

[mbed] ERROR: "/usr/bin/python" returned error.

(I know, not much descriptive... but I do not see any ERRORs during building, only: multiple definition of or first defined here)

So perhaps any known issues reffering to above?
Has anyone tried to complete this guide?

Hints more than welcome.

@marcin-ch
Copy link
Author

Not sure if I call it a workaround but finally I have this example running.
I just changed the final call to:

#Run this command in cmsisnn_demo folder
mbed compile -m DISCO_F746NG -t GCC_ARM --source . --source ../ML-examples/cmsisnn-cifar10/code/m7 --source ../ML-examples/cmsisnn-cifar10/camera_demo/camera_with_nn/ --source ../CMSIS_5/CMSIS/NN/Include --source ../CMSIS_5/CMSIS/NN/Source --source ../CMSIS_5/CMSIS/DSP/Include --source ../CMSIS_5/CMSIS/Core/Include -j8

it means I just simply cut this one:

--source ../CMSIS_5/CMSIS/DSP/Source

@marcin-ch
Copy link
Author

just to close the issue and prove that I went through all the steps and got working demo 😆
STM32F746G-DISCO_CMSIS-NN_CIFAR10_hardware

@youngolutosin
Copy link

Hello marcin_ch, I am currently working on this project for my thesis. Please I need help getting it through. Do you have the link to step by step procedures so that I can follow?

@marcin-ch
Copy link
Author

marcin-ch commented Jul 10, 2019

Hi @youngolutosin ,
I followed this guide Image recognition on Arm Cortex-M with CMSIS-NN guide as mentioned in my first post here. You can download this guide as PDF file (please see "Download PDF" option).

@youngolutosin
Copy link

youngolutosin commented Jul 11, 2019

I have gone through the steps and I was able to Implement the first basic camera example and it worked. I am stucked at check failed:mdb_status == 0 (2 vs.0) No file or directory. I have edited the mean_file and source file but in caffe/exmaples/cifar10 directory, I don't have mean.binaryproto, cifar10_train_lmdb and cifar10_test_lmdb. Please how did you solve the problem? Thank you in advance.

@marcin-ch
Copy link
Author

Hi @youngolutosin ,
first of all, make sure you double-checked Troubleshooting guide

And then have a look at issue I created here with the same question as you. Hope that helps.

@youngolutosin
Copy link

youngolutosin commented Jul 15, 2019 via email

@marcin-ch
Copy link
Author

@youngolutosin ,
yup, model is not very reliable, but they mentioned about it in the guide:

Note: that this model is very easily affected by changes in light conditions, we have chosen it only for simplicity.

And what may be also helpful for you is the keyword: transfer learning.
In simple words you can use some already existing/trained model for image classification and re-train it using your dataset. It should greatly shorten the amount of time needed to train the model.

Hope that helps and good luck!

@shell0108
Copy link

@marcin-ch @youngolutosin Hello ! I'm doing the same CMSIS_NN CIFAR10 example ,following the same guide ,but I met some problems.

It seems that you have done it successfully, and I will be very grateful if you offered some help!
here is my _issue,
012F59C52412AB9052DD5CFD21F4F036

@joshbindels
Copy link

Hi @youngolutosin @marcin-ch @shell0108 ,

I'm currently working on this project for my thesis as well.

Did you notice a difference when running the model on the board or on a laptop?
When I run accuracy tests using caffe or as a python script on my host machine I'm getting a decent accuracy. But, when I run a similar accuracy test on the board the accuracy is quite low, ~30%.

@youngolutosin
Copy link

youngolutosin commented Nov 8, 2020 via email

@joshbindels
Copy link

joshbindels commented Nov 8, 2020 via email

@youngolutosin
Copy link

youngolutosin commented Nov 8, 2020 via email

@beyonson
Copy link

Hello @marcin-ch

I know this is a very old project for you, but I am trying to figure out this camera for another project and I am having trouble with the stm32 DCMI. I was wondering if you could upload the generated bin file you get when running the lines:

cd cmsisnn_demo/
mbed compile -m DISCO_F746NG -t GCC_ARM --source . --source ../ML-examples/cmsisnn-cifar10/camera_demo/camera_app/

Although my end goal is ML, I really need to figure out how to use the camera first. I would really appreciate any advice or help, thanks!!

@marcin-ch
Copy link
Author

@beyonson

where should this .bin file be located? As you mentioned, it's been a while since I touched this project last time, so I need some guidance.
Is this path below right one?
~/CMSISNN_Webinar/cmsisnn_demo/BUILD/DISCO_F746NG/GCC_ARM
if so, then please see attached, and please notice I have no hardware to check it on my end, so I am sending it AS IS with hope that it is working version.
cmsisnn_demo.zip

@NarendraKumarMadireddy
Copy link

Hi @youngolutosin ,
I followed this guide Image recognition on Arm Cortex-M with CMSIS-NN guide as mentioned in my first post here. You can download this guide as PDF file (please see "Download PDF" option).

Can you share your project report, I am working image recognition using cortex processor with cmsis library, can you help me in completing the project, I don't have much knowledge on this topic.

@marcin-ch
Copy link
Author

@NarendraKumarMadireddy seems this is the one
Image recognition on Arm Cortex-M with CMSIS-NN.pdf
and Youtube video as well which might be helpful
Image recognition on Arm Cortex-M with CMSIS-NN in 5 steps

@youngolutosin
Copy link

youngolutosin commented Aug 15, 2023 via email

@NarendraKumarMadireddy
Copy link

Hello All,

I am following this Image recognition on Arm Cortex-M with CMSIS-NN guide

I have exactly the same hardware:

STM32F746G-DISCO
STM32F4DIS-CAM

the same software installed

Ubuntu 16.04 LTS
Python 2.7.12
Caffe
GNU Tools for Arm Embedded Processors 7-2017-q4-major

and I am able to reproduce all mentioned in the guide steps (including building basic camera app, quantizing the model, converting the model), except the final one! = Deploy transformed model on an Arm Cortex-M processor

The final call is:

#Run this command in cmsisnn_demo folder
mbed compile -m DISCO_F746NG -t GCC_ARM --source . --source ../ML-examples/cmsisnn-cifar10/code/m7 --source ../ML-examples/cmsisnn-cifar10/camera_demo/camera_with_nn/ --source ../CMSIS_5/CMSIS/NN/Include --source ../CMSIS_5/CMSIS/NN/Source --source ../CMSIS_5/CMSIS/DSP/Include --source ../CMSIS_5/CMSIS/DSP/Source --source ../CMSIS_5/CMSIS/Core/Include -j8

The only difference is in

--source ../ML-examples/cmsisnn-cifar10/camera_demo/camera_with_nn/

the original call refers to

--source ../ML-examples/cmsisnn-cifar10/camera_demo/camera_app/

But I have not changed camera_app folder, just used already prepared by ARM folder with camera_with_nn (ARM provides ready-to-go camera apps without NN and with NN, here)

And mbed finishes with info

[mbed] ERROR: "/usr/bin/python" returned error.

(I know, not much descriptive... but I do not see any ERRORs during building, only: multiple definition of or first defined here)

So perhaps any known issues reffering to above?
Has anyone tried to complete this guide?

Hints more than welcome.

Can you share your project report, I am working on this image recognition using cortex processor with cmsis library, can you help me in completing the project, I don't have much knowledge on this topic.

Can you share the correct detailed step by step process.

@NarendraKumarMadireddy
Copy link

Hello marcin_ch, I am currently working on this project for my thesis. Please I need help getting it through. Do you have the link to step by step procedures so that I can follow?

Can you share your project report, I am working image recognition using cortex processor with cmsis library, can you help me in completing the project, I don't have much knowledge on this topic.

Can you share me the step by step procedure please 🥺.

@NarendraKumarMadireddy
Copy link

Hi @youngolutosin @marcin-ch @shell0108 ,

I'm currently working on this project for my thesis as well.

Did you notice a difference when running the model on the board or on a laptop?
When I run accuracy tests using caffe or as a python script on my host machine I'm getting a decent accuracy. But, when I run a similar accuracy test on the board the accuracy is quite low, ~30%.

Can you share your project report, I am working image recognition using cortex processor with cmsis library, can you help me in completing the project, I don't have much knowledge on this topic.

Can you share me the step by step procedure 🥺 please

@youngolutosin
Copy link

youngolutosin commented Aug 15, 2023 via email

@NarendraKumarMadireddy
Copy link

@NarendraKumarMadireddy seems this is the one
Image recognition on Arm Cortex-M with CMSIS-NN.pdf
and Youtube video as well which might be helpful
Image recognition on Arm Cortex-M with CMSIS-NN in 5 steps

Thankyou but can you share me some report or etc , I am new to Linux and caffe

@NarendraKumarMadireddy
Copy link

I don’t have access to the project anymore. Please sto spamming.

On Tue, 15. Aug 2023 at 15:31, Narendra Kumar @.***>
wrote:

Hi @youngolutosin https://github.com/youngolutosin @marcin-ch
https://github.com/marcin-ch @shell0108 https://github.com/shell0108 ,

I'm currently working on this project for my thesis as well.

Did you notice a difference when running the model on the board or on a
laptop?
When I run accuracy tests using caffe or as a python script on my host
machine I'm getting a decent accuracy. But, when I run a similar accuracy
test on the board the accuracy is quite low, ~30%.

Can you share your project report, I am working image recognition using
cortex processor with cmsis library, can you help me in completing the
project, I don't have much knowledge on this topic.

Can you share me the step by step procedure 🥺 please


Reply to this email directly, view it on GitHub
#16 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AK2TEGLZGHOMYGE5MLC72TDXVNT37ANCNFSM4HJC4N2A
.
You are receiving this because you were mentioned.Message ID:
@.***>

--


Regards,

Olutosin​ ​Ademola

+37253564286,

DevOps Engineer | ML Engineer

Tallinn, Estonia.

Sorry , thankyou

@NarendraKumarMadireddy
Copy link

Last question, do anyone have the windows version tutorial/PDFs/report of this project?

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

6 participants