TFLite For Microcontrollers In VS2019 On Windows

9 views
Skip to first unread message

Jonathan Torkelson

unread,
Feb 28, 2021, 7:05:52 PMFeb 28
to SIG Build
Hello,
Is there currently any option to build and run a TFLite for Microcontrollers application in VS2019 on Windows using MSVC? I don't believe there's anything like that in the GitHub repository, and the TFLite for Microcontrollers Make/CMake/Bazel examples I have tried seem to fail. 

I was able to get an old version of Tensorflow Lite to compile in VS2019, however I've been running into issues with 2.4.1. There seems to be some issues that MSVC compiler has with the code that GNU is OK with, things like constant empty array initializers. Just interested in seeing if this is already available somewhere.

Thanks!

Austin Anderson

unread,
Mar 1, 2021, 12:36:08 PMMar 1
to Jonathan Torkelson, SIG Build
Hey Jonathan,

What build steps are you following? Can you link to the instructions you're using?

You could also try downgrading MSVC. There's at least one bug in MSVC 14.28 affecting the latest TensorFlow, and MSVC 14.27 ("Microsoft.VisualStudio.Component.VC.14.27.x86.x64" in .vsconfig) worked better for us. 

Austin

--
To unsubscribe from this group and stop receiving emails from it, send an email to build+un...@tensorflow.org.

Jonathan Torkelson

unread,
Mar 1, 2021, 1:02:17 PMMar 1
to SIG Build, Austin Anderson, SIG Build, Jonathan Torkelson
Hi Austin,
Some time back with an older version of Tensorflow (2.0.0 I believe), I used make to build the magic_wand example. This pulled dependencies down into my PC, and from there I was able to tediously pull this into a Visual C project and build it. This Visual C build of the old Tensorflow Lite for Microcontrollers code is having issues interpreting a model I created with 2.4.1, so I have been trying to redo everything with the latest.

I have tried the following:
  • CMake build of Tensorflow Lite in Windows. This had bugs that were fixed over the weekend, but now builds for me. See this issue for all the gory details. This morning I have started trying to pull the code into a Visual C project, but am floundering, trying to find exactly what is and isn't needed from Tensorflow Lite. There's just too much code.
  • Make build of the magic wand example. See this issue for the details on that. If this built properly, then I would at least have a basic microcontroller example that built on my Windows machine that I could use as a reference. My build details are at the top of that issue. Make currently doesn't appear to work for the TFLite for Microcontrollers examples on Windows, only Linux. " amahendrakar" in that issue referenced me to other issues, but no solution. 
I'm trying to get Tensorflow Lite building and running in our embedded hardware virtualization platform, Virtuoso, so developers can just download an example project and debug it in Visual Studio, even pull in real-world I/O. But my immediate need is using it in a critical project. I have a model trained and ready to deploy, but the interpreter is returning null pointers for the input and output tensors.

Thanks!

Reply all
Reply to author
Forward
0 new messages