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

tf.lite example with custom train model issue #79

Open
terryll opened this issue Oct 10, 2022 · 2 comments
Open

tf.lite example with custom train model issue #79

terryll opened this issue Oct 10, 2022 · 2 comments

Comments

@terryll
Copy link

terryll commented Oct 10, 2022

I followed the CVInterop.Lite.Net example and everything work. However, when I custom train an tf.lite classification model (ssdMobileV2), the return results are byte[8] instead of float[8] for _outputTensor.Data.
If byte expected?
If so, how do I interpreted the results?
Thanks in advance,
Terry

@emgucv
Copy link
Owner

emgucv commented Oct 12, 2022

The Tensor object can return byte[] if Tensord.DataType is UInt8:
https://www.emgu.com/wiki/files/emgutf/2.8.0/document-lite/html/8f3e0a49-e7c4-3cb0-7213-1f4fe1ae9227.htm

You can follow this instructions for model loading issues:
https://www.emgu.com/wiki/index.php/My_model_doesn%27t_work#Your_demo_works.2C_I_replaced_with_my_model_and_it_fails

You should always make sure your own model can be loaded and perform inference in python first, then replicate the same pyhon routine in C# with Emgu TF Lite.

Hope that helps.

@terryll
Copy link
Author

terryll commented Oct 18, 2022

Thanks for the suggestion. It ends up that I did not resigned the image causing unexpected results. However, the processing speed is much longer than expected. If I understand correctly, the tf.lite may need to rebuild based on the particular CPU in order to get the performance expected. I gave up that option for now.
I try to use emgu.tf. When I run the example (CVInterop.NetCore), there is an error message "Error CS0246 The type or namespace name 'ConfigProto' could not be found ". Did I missed something on the installation ?
I have went through the document and google the error, But not able to go pass this compile error on the sample program.
Thanks in advance,
Terry

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