Skip to content

Instantly share code, notes, and snippets.

@ShawnHymel
Last active April 3, 2026 15:40
Show Gist options
  • Select an option

  • Save ShawnHymel/79237fe6aee5a3653c497d879f746c0c to your computer and use it in GitHub Desktop.

Select an option

Save ShawnHymel/79237fe6aee5a3653c497d879f746c0c to your computer and use it in GitHub Desktop.
TensorFlow Lite Sinewave Regression Training and Conversion
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abhi-84

abhi-84 commented Nov 16, 2021

Copy link
Copy Markdown

What alternative board would be used to implement this example instead of NUCLEO-32 STM32L432KC EVAL BRD since this board is not available online. please suggest

@ShawnHymel

Copy link
Copy Markdown
Author

@abhi-84 Almost any STM32 ARM Cortex-M3 or M4 should work (setting it up in CubeMX might be a little different, depending on the particular MCU or board). Some Cortex-M0 or M0+ MCUs might work...I just haven't tried them yet.

@whubaichuan

Copy link
Copy Markdown

@suman346 @ericobropinto @ShawnHymel Some possible solutions for Unknown format code 'x' for object of type 'str".

I have met this problem but solved it by changing it slightly. So be careful about the file and directory.

From

file.write(hex_to_c_array('./modellite.tflite', c_model_name))

to

file.write(hex_to_c_array(tflite_model, c_model_name))

Then it works.

@soumengoroi

Copy link
Copy Markdown

Create header guard

c_str += '#ifndef ' + var_name.upper() + '_H\n'
c_str += '#define ' + var_name.upper() + '_H\n\n'


-- Here I am facing error
"AttributeError: 'Interpreter' object has no attribute 'upper''

@ShawnHymel

Copy link
Copy Markdown
Author

@soumengoroi Check the value of var_name being passed into that function. It should be a string (and set by c_model_name as the argument)

@richardhemphill

richardhemphill commented Sep 23, 2023

Copy link
Copy Markdown

There is a typo in the 3rd code cell. Change versionS to version.
!python --version

@hilalucakci1212-hash

Copy link
Copy Markdown

where is data set link???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment