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

Adding custom ML tflite models with CFU #452

Open
bala122 opened this issue Feb 4, 2022 · 9 comments
Open

Adding custom ML tflite models with CFU #452

bala122 opened this issue Feb 4, 2022 · 9 comments

Comments

@bala122
Copy link

bala122 commented Feb 4, 2022

I'm not sure about the procedure to add your own custom tflite model with CFU. Does this framework support custom ML models as well?
I'm getting this issue when I attempt at adding a new model in the makefile:

/home/shivaubuntu/riscv64-unknown-elf-gcc-10.1.0-2020.08.2-x86_64-linux-ubuntu14/bin/../lib/gcc/riscv64-unknown-elf/10.1.0/../../../../riscv64-unknown-elf/bin/ld: src/models/models.o: in function .LANCHOR0': models.c:(.sdata.MENU+0x10): undefined reference to no_menu'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:163: software.elf] Error 1
make[1]: Leaving directory '/home/shivaubuntu/CFU-playground/CFU-Playground/proj/proj_custom/build'
make: *** [../proj.mk:215: /home/shivaubuntu/CFU-playground/CFU-Playground/proj/proj_custom/build/software.elf] Error 2

@bala122
Copy link
Author

bala122 commented Feb 4, 2022

I've even followed all the steps by an earlier issue:
#221

I'm still getting the same error. I'm using the August build of the SiFive compiler:
https://github.com/sifive/freedom-tools/releases/tag/v2020.08.0
I've even tried using the riscv64 gcc compiler available in riscv-gnu toolchain, but even that doesnt seem to work.
Any suggestions on compilers to use would be helpful

@alanvgreen
Copy link
Collaborator

Hi @bala122,

Did you follow this part of the instructions?

After creating your model folder, make it accessible from the menus by adding it to
/common/src/models.c.

If that's not the problem, could you perhaps upload a Draft PR containing your code so far, and someone might be able to take a look at it.

Thanks,

Alan

@bala122
Copy link
Author

bala122 commented Feb 6, 2022

Hi, yes I've tried that, but the issue is still present. Ive added a Draft PR:
#456
Specifically under "sudo make renode", I'm getting this:

make[1]: riscv64-unknown-elf-g++: Command not found
make[1]: *** [Makefile:163: software.elf] Error 127
make[1]: Leaving directory '/home/shivaubuntu/CFU-playground/CFU-Playground/proj/proj_custom/build'
make: *** [../proj.mk:215: /home/shivaubuntu/CFU-playground/CFU-Playground/proj/proj_custom/build/software.elf] Error 2

@alanvgreen
Copy link
Collaborator

alanvgreen commented Feb 6, 2022

Thanks for uploading your code. I only had time to take a quick look, but I can't see an obvious problem with it.

make[1]: riscv64-unknown-elf-g++: Command not found

Make is saying that it can't find the RISCV C++ compiler on your path. Could you maybe try fixing that, first?

@bala122
Copy link
Author

bala122 commented Feb 7, 2022

I've installed the August version of the SiFive gcc compiler from freedom tools:
https://github.com/sifive/freedom-tools/releases/tag/v2020.08.0
I've even tried with the normal riscv-gnu-toolchain compiler it didnt work. I think the compiler is recognized whenever I type "which riscv64-unknown-elf-g++"

@tcal-x
Copy link
Collaborator

tcal-x commented Feb 8, 2022

Specifically under "sudo make renode", I'm getting this:

Hi @bala122 , can you send me the link to where you see this specifically? I'm puzzled why the instructions say to use "sudo".
Thanks!

@bala122
Copy link
Author

bala122 commented Feb 8, 2022

Hi, actually the issue is resolved I think. I deleted the soc build and redid it with the normal "make renode" command, it worked. I'll let you know if there are any further issues.
Thanks,
Bala.

@tcal-x
Copy link
Collaborator

tcal-x commented Feb 8, 2022

Hi @bala122 , thanks for the update; if you have any suggestions for improving the documentation, we would like to hear! I know it is quite complicated and we might not explain every step well.

Do you think you will upstream your model at some point? It's fine either way of course.

@bala122
Copy link
Author

bala122 commented Mar 24, 2022

Hi, yes Ill try to give suggestions later on regarding the documentation. As of now I havent fully finished the design, so Ill let you know about that when its done.
Thanks.

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

3 participants