Problems using a trained model exported "as library"

Post Reply
battlecoder
Posts: 8
Joined: Thu Mar 25, 2021 6:58 am

Hi,
So I'm having some issues using the trained model as a library in my project.

So far this has been my process:
  1. I did the data collection using a different board (because I didn't have a QuickFeather at that point). Data was sent to a NodeRED endpoint and stored in a DB.
  2. I exported said data as CSV.
  3. I also created a custom SSF file in which I declare a single "sensor" that encapsulates the input variables.
  4. I added this SSF to Data Capture Lab, which enabled me to import the CSVs and label them for the classification model.
  5. I trained a model on SensiML analytics studio and exported it as a library, for the Simple Streaming Example.
Up to here everything was going fine and more or less according to what I expected. From this point, however, I have the following problems:
  1. The "copy_files" script included in the knowledge pack fails because sml_output.c is not there.
  2. Once I replace the files in the qf_ssi_ai_app example with the files from the knowledge pack, the application no longer compiles. It fails with the following error:
    sml_output.c:49: undefined reference to `sml_get_feature_vector'
(That is exactly the file that wasn't found in the knowledge pack to overwrite)

Also important:
  • I had previously verified that I can successfully compile the qf_ssi_ai_app in recognition mode before I replaced the files with the ones in the KP.
  • I know that (according to the README.rst in the qf_ssi_ai_app folder) I need to do other changes for the app to actually parse my data and run the model successfully, but I think the project should at least compile with the files from the knowledge pack, even if it would misbehave at runtime until I fix the definitions.
Please also consider that my project requires obtaining data samples quite spaced (5 minutes per reading) during at least a couple of weeks, so it's not like I can re-do the capture with the QuickFeather board and my custom SSF now that I have it. Frequency is also probably going to be a problem for the classification algorithm, since I had to train it declaring a frequency of 1 Hz (which is a lie, but I think it didn't go lower than that). I guess I can just repeat the last reading for 5 minutes straight until it's time to get a new one, but that's a problem for the future, once I'm able to compile the demo with the new model.
battlecoder
Posts: 8
Joined: Thu Mar 25, 2021 6:58 am

Ok, so after checking some files in the output folder I realized the missing symbol (sml_get_feature_vector) was declared in the previous compilation of the vanilla example and was left there in the partially compiled output. In the (new) knowledgepack set of files it was just an alias for kb_get_feature_vector. However the existing and previously compiled sml_output.c was unaware of this new mapping (as it wasn't being recompiled since it didn't change) so from its point of view the symbol was missing.

So long story short: a make clean cleared that error.

Now I guess I need to actually integrate the sensor into this whole thing, and I'll probably still run into issues because of the acquisition frequency, but at the least the initial hurdle has been solved, and I'm leaving this post here in case anyone else runs into the same issue.
Post Reply