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

addQuantize and addDequantize in th_final_initialize of anamoly detection submitter_implemented.cpp #101

Open
dagaranton opened this issue Jul 14, 2021 · 7 comments

Comments

@dagaranton
Copy link

Would it be possible to receive an explanation on towards why these functions are being used in the th_final_initialize function. From what I can see, they only run a check and are never used anymore. I ask because I am having some trouble importing the files needed for them to work onto my project. The issue being that adding all the source files needed for those functions makes me go over my memory requirements.

submitter_implemented_question

Basically, are these functions/checks essential to the project or would I be able to leave them out?

@colbybanbury
Copy link
Contributor

Those are the functions that add the required operations to the TFLite Micro interpreter. Without them, I don't think the model will be able to successfully execute because it wouldn't be able to resolve calls to any of the layers.

micro_op_resolver.AddFullyConnected() is a function that adds the fully connect operation to the op resolver. It returns kTfLiteOk if the function executes successfully.

What are your memory requirements? I may be able to help optimize the memory.

@dagaranton
Copy link
Author

Right now I am trying to report all the source files needed to get those functions running again; so that I can show you what happens. However, it is taking longer than expected so I will give an update as soon as possible

The device has 352kB of flash and 80kB of RAM. Before adding all the source files needed for the AddQuant and AddDequant I am roughly using 95%-97% of the flash already. I already had all the files needed for the AddFullyConnected functions. Last time I tried to add all the files I began to go over the memory requirements.

Also, I am not quite sure if this file is needed. It shows up in a few files but it is not a source or header file. Also, when I go into the file it is just a single line definition.

EigenCore_Image

@colbybanbury
Copy link
Contributor

Looking at the model (below) it seems the int8 model we provide doesn't need the quantize/dequantize operations so you should be able to remove those.

What do you mean by "had all the files needed for the AddFullyConnected functions". You should probably keep micro_op_resolver.AddFullyConnected().
image

@dagaranton
Copy link
Author

Sorry, I just meant that AddFullyConnected() was working with no problem. It was the quantize/dequantize giving me the issues.

So I should be fine just keeping micro_op_resolver.AddFullyConnected() while removine micro_op_resolver.AddQuantize() and micro_op_resolver.AddFullyDeQuantize().

@colbybanbury
Copy link
Contributor

If you are using the int8 model we provide then yet I think that should work.

Let me know how it goes!

@dagaranton
Copy link
Author

Hello,

I tried running the project with the micro_op_resolver.AddFullyConnected() function, but it caused the an overflow of FLASH by 377 bytes. Is there any way of optimizing the memory?

Thank you!

@dagaranton
Copy link
Author

Update: The flash overflow is at 10805 bytes now

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

2 participants