Announcements

Help us improve the Power & Sensing Selection Guide. Share feedback

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
jsmith678x
Level 4
Level 4
100 sign-ins 25 replies posted First solution authored

Hi,

I'm trying to use libtensorflow-microlite.a library directly but there is a 'main' function in the library so ModusToolBox can't link my app. I think you should remove this 'main' function, this is a library not an App!

C:\Work\mtw\PSoc6_Img_Class/source/main.c:8: multiple definition of `main'; ../mtb_shared/ml-tflite-micro/release-v2.0.0/COMPONENT_ML_TFLM_INTERPRETER/COMPONENT_CM4/COMPONENT_IFX_CMSIS_NN/COMPONENT_HARDFP/TOOLCHAIN_GCC_ARM\libtensorflow-microlite.a(util_test.o):util_test.cc:(.text.startup.main+0x0): first defined here

 

0 Likes
1 Solution
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

I was able to build your project after following these steps:

1) Remove the instructions from your Makefile related to the TFLM

2) Copy the deps/ml-tlite-micro.mtb file from the mtb-example-ml-profiler code example to your deps/ folder.

3) Run the "make getlibs" commands to download the TFLite micro

4) Add the following components in the Makefile:

COMPONENTS=ML_TFLM_INTERPRETER IFX_CMSIS_NN
 
5) Add the following define in the Makefile:
DEFINES=TF_LITE_STATIC_MEMORY
 
Our Makefile infrastructure will enforce the correct way to add the dependencies to your project. 

View solution in original post

0 Likes
9 Replies
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @jsmith678x 

Are you able to see the multiple definition error after removing the main function from the library?

Thanks and Regards,
Leo

0 Likes
jsmith678x
Level 4
Level 4
100 sign-ins 25 replies posted First solution authored

After removing util_test.o

 

jsmith678x_0-1700204478247.png

 

0 Likes
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

Are you able to build one of our ML profiler code examples?

Do you have a util_test.cc file in your project?

0 Likes
jsmith678x
Level 4
Level 4
100 sign-ins 25 replies posted First solution authored

I've successfully compiled 'Machine_Learning_Neural_Network_Profiler'

No, I don't have util_test.cc. 

0 Likes
Can you share your project?
0 Likes
lock attach
Attachments are accessible only for community members.

I've shared the project

0 Likes
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

We are debugging this issue.

In the meanwhile, is it possible to leverage the ml-middleware to abstract the tensor-flow library? This way, you can keep you main code totally in C language, instead of mixing with C++.

0 Likes
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

I was able to build your project after following these steps:

1) Remove the instructions from your Makefile related to the TFLM

2) Copy the deps/ml-tlite-micro.mtb file from the mtb-example-ml-profiler code example to your deps/ folder.

3) Run the "make getlibs" commands to download the TFLite micro

4) Add the following components in the Makefile:

COMPONENTS=ML_TFLM_INTERPRETER IFX_CMSIS_NN
 
5) Add the following define in the Makefile:
DEFINES=TF_LITE_STATIC_MEMORY
 
Our Makefile infrastructure will enforce the correct way to add the dependencies to your project. 
0 Likes
LeoMathews
Moderator
Moderator
Moderator
First question asked 500 replies posted 100 solutions authored

Hi @jsmith678x 

Thread was locked due to inactivity for long time, you can continue the discussion on the topic by opening a new thread with reference to the locked one. The continuous discussion in an inactive thread may mostly be unattended by community users.

Thanks and Regards<
Leo

0 Likes