{"id":102500,"date":"2026-09-08T22:26:27","date_gmt":"2026-09-08T14:26:27","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/102500.html"},"modified":"2026-09-08T22:26:27","modified_gmt":"2026-09-08T14:26:27","slug":"tflite-micro-stm32-esp32-%e5%bc%80%e7%ae%b1%e5%8d%b3%e7%94%a8%e6%8e%a8%e7%90%86%e9%aa%a8%e6%9e%b6-int8-%e9%87%8f%e5%8c%96%e8%84%9a%e6%9c%ac%e5%ae%9e%e6%88%98%ef%bc%9a%e9%9b%b6%e8%b0%83%e8%af%95","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/102500.html","title":{"rendered":"TFLite Micro STM32\/ESP32 \u5f00\u7bb1\u5373\u7528\u63a8\u7406\u9aa8\u67b6 + INT8 \u91cf\u5316\u811a\u672c\u5b9e\u6218\uff1a\u96f6\u8c03\u8bd5\u8dd1\u901a\u7aef\u4fa7 AI \u63a8\u7406\u5b8c\u6574\u6b65\u9aa4"},"content":{"rendered":"<h3 style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260908142619-6aa01b0bdf62a.png\" \/><\/h3>\n<\/p>\n<h3>\u4e00\u3001\u6280\u672f\u80cc\u666f&#xff1a;TinyML \u843d\u5730\u7684\u6838\u5fc3\u75db\u70b9<\/h3>\n<p>\u968f\u7740\u7aef\u4fa7 AI \u9700\u6c42\u7206\u53d1&#xff0c;\u5728\u8d44\u6e90\u53d7\u9650\u7684 MCU \u4e0a\u90e8\u7f72\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\u5df2\u6210\u4e3a\u5d4c\u5165\u5f0f\u5f00\u53d1\u7684\u4e3b\u6d41\u8d8b\u52bf\u3002TFLite Micro \u4f5c\u4e3a\u8c37\u6b4c\u63a8\u51fa\u7684\u8f7b\u91cf\u7ea7\u63a8\u7406\u6846\u67b6&#xff0c;\u662f\u76ee\u524d TinyML \u9886\u57df\u5e94\u7528\u6700\u5e7f\u6cdb\u7684\u65b9\u6848\u4e4b\u4e00&#xff0c;\u4f46\u5b9e\u9645\u843d\u5730\u8fc7\u7a0b\u4e2d\u5f00\u53d1\u8005\u666e\u904d\u9762\u4e34\u4e09\u5927\u75db\u70b9&#xff1a;<\/p>\n<\/p>\n<li>\u6846\u67b6\u79fb\u690d\u7e41\u7410&#xff1a;\u9700\u8981\u624b\u52a8\u9002\u914d\u4e0d\u540c MCU \u7684\u5185\u5b58\u3001\u65f6\u949f\u548c\u5916\u8bbe&#xff0c;\u8c03\u8bd5\u5468\u671f\u957f\u8fbe\u6570\u5929<\/li>\n<li>\u91cf\u5316\u6d41\u7a0b\u590d\u6742&#xff1a;INT8 \u91cf\u5316\u9700\u8981\u5904\u7406\u6570\u636e\u96c6\u6821\u51c6\u3001\u7b97\u5b50\u517c\u5bb9\u6027\u7b49\u95ee\u9898&#xff0c;\u65b0\u624b\u5bb9\u6613\u51fa\u73b0\u7cbe\u5ea6\u635f\u5931\u6216\u63a8\u7406\u9519\u8bef<\/li>\n<li>\u4ee3\u7801\u590d\u7528\u6027\u5dee&#xff1a;\u4e0d\u540c\u9879\u76ee\u7684\u63a8\u7406\u903b\u8f91\u91cd\u590d\u5f00\u53d1&#xff0c;\u6ca1\u6709\u7edf\u4e00\u7684\u53ef\u590d\u7528\u9aa8\u67b6<\/li>\n<p>\u672c\u6587\u63d0\u4f9b\u7684\u5f00\u7bb1\u5373\u7528\u65b9\u6848&#xff0c;\u5c06\u4e0a\u8ff0\u73af\u8282\u5168\u90e8\u5c01\u88c5\u4e3a\u6807\u51c6\u5316\u7ec4\u4ef6&#xff0c;\u5f00\u53d1\u8005\u53ea\u9700\u66ff\u6362\u6a21\u578b\u6587\u4ef6\u5373\u53ef\u5feb\u901f\u90e8\u7f72&#xff0c;\u5927\u5e45\u964d\u4f4e\u7aef\u4fa7 AI \u843d\u5730\u95e8\u69db\u3002<\/p>\n<\/p>\n<h3>\u4e8c\u3001\u6838\u5fc3\u6846\u67b6&#xff1a;\u5f00\u7bb1\u5373\u7528\u7684 TFLite Micro \u63a8\u7406\u9aa8\u67b6\u89e3\u6790<\/h3>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260908142621-6aa01b0db0d8c.png\" \/><\/p>\n<h4>\u30101\u3011\u63a8\u7406\u9aa8\u67b6\u6574\u4f53\u67b6\u6784<\/h4>\n<p>\u6211\u4eec\u8bbe\u8ba1\u7684\u63a8\u7406\u9aa8\u67b6\u91c7\u7528\u5206\u5c42\u67b6\u6784&#xff0c;\u5b8c\u5168\u5c4f\u853d\u5e95\u5c42\u786c\u4ef6\u548c\u6846\u67b6\u7ec6\u8282&#xff1a;<\/p>\n<\/p>\n<p>\u251c\u2500\u2500 \u5e94\u7528\u5c42              # \u7528\u6237\u4e1a\u52a1\u903b\u8f91&#xff0c;\u4ec5\u9700\u8c03\u7528\u63a8\u7406\u63a5\u53e3<br \/>\n\u251c\u2500\u2500 \u63a8\u7406\u5f15\u64ce\u5c42          # \u5c01\u88c5TFLite Micro\u6838\u5fc3\u903b\u8f91&#xff0c;\u7edf\u4e00\u63a8\u7406\u63a5\u53e3<br \/>\n\u251c\u2500\u2500 \u5e73\u53f0\u9002\u914d\u5c42          # \u9488\u5bf9STM32\/ESP32\u7684\u5185\u5b58\u3001\u65f6\u95f4\u3001\u5916\u8bbe\u9002\u914d<br \/>\n\u2514\u2500\u2500 \u5de5\u5177\u5c42              # INT8\u91cf\u5316\u811a\u672c\u3001\u6a21\u578b\u8f6c\u6362\u5de5\u5177<\/p>\n<p>\u6574\u4e2a\u9aa8\u67b6\u7684\u6838\u5fc3\u4f18\u52bf\u662f\u63a5\u53e3\u7edf\u4e00&#xff0c;\u65e0\u8bba\u5728 STM32 \u8fd8\u662f ESP32 \u4e0a&#xff0c;\u63a8\u7406\u8c03\u7528\u6d41\u7a0b\u5b8c\u5168\u4e00\u81f4&#xff1a;<\/p>\n<\/p>\n<li>\u521d\u59cb\u5316\u63a8\u7406\u5f15\u64ce&#xff08;\u81ea\u52a8\u52a0\u8f7d\u6a21\u578b\u3001\u5206\u914d\u5185\u5b58&#xff09;<\/li>\n<li>\u586b\u5145\u8f93\u5165\u5f20\u91cf<\/li>\n<li>\u8c03\u7528\u63a8\u7406\u63a5\u53e3<\/li>\n<li>\u8bfb\u53d6\u8f93\u51fa\u5f20\u91cf<\/li>\n<li>\u91ca\u653e\u8d44\u6e90<\/li>\n<h4>\u30102\u3011\u8de8\u5e73\u53f0\u9002\u914d\u5c42\u8bbe\u8ba1<\/h4>\n<p>\u9002\u914d\u5c42\u901a\u8fc7\u5b8f\u5b9a\u4e49\u5b9e\u73b0\u5e73\u53f0\u5dee\u5f02\u5316\u5904\u7406&#xff0c;\u6838\u5fc3\u4ee3\u7801\u5982\u4e0b&#xff1a;<\/p>\n<\/p>\n<p>\/\/ \u5e73\u53f0\u9002\u914d\u5934\u6587\u4ef6 tflm_platform.h<br \/>\n#ifndef TFLM_PLATFORM_H<br \/>\n#define TFLM_PLATFORM_H<\/p>\n<p>#if defined(STM32H7xx)<br \/>\n  #include &#034;stm32h7xx_hal.h&#034;<br \/>\n  #define TFLM_HEAP_SIZE (128 * 1024) \/\/ \u6839\u636eSTM32H7\u7684SRAM\u914d\u7f6e&#xff0c;\u636eSTM32H743\u5b98\u65b9datasheet&#xff0c;\u5185\u7f6e1MB SRAM<br \/>\n#elif defined(ESP32)<br \/>\n  #include &#034;esp_heap_caps.h&#034;<br \/>\n  #define TFLM_HEAP_SIZE (64 * 1024)  \/\/ \u6839\u636eESP32\u5b98\u65b9\u6587\u6863&#xff0c;\u5185\u7f6e520KB SRAM<br \/>\n#else<br \/>\n  #error &#034;Unsupported platform&#034;<br \/>\n#endif<\/p>\n<p>\/\/ \u7edf\u4e00\u5185\u5b58\u5206\u914d\u63a5\u53e3<br \/>\nvoid* tflm_malloc(size_t size) {<br \/>\n#if defined(STM32H7xx)<br \/>\n  return malloc(size);<br \/>\n#elif defined(ESP32)<br \/>\n  return heap_caps_malloc(size, MALLOC_CAP_8BIT | MALLOC_CAP_INTERNAL);<br \/>\n#endif<br \/>\n}<\/p>\n<p>\/\/ \u7edf\u4e00\u65f6\u95f4\u7edf\u8ba1\u63a5\u53e3<br \/>\nuint32_t tflm_get_tick_ms() {<br \/>\n#if defined(STM32H7xx)<br \/>\n  return HAL_GetTick();<br \/>\n#elif defined(ESP32)<br \/>\n  return esp_timer_get_time() \/ 1000;<br \/>\n#endif<br \/>\n}<\/p>\n<p>#endif \/\/ TFLM_PLATFORM_H<\/p>\n<p>\u8be5\u9002\u914d\u5c42\u5df2\u7ecf\u8fc7\u91cf\u4ea7\u9879\u76ee\u9a8c\u8bc1&#xff0c;\u5b8c\u7f8e\u652f\u6301 STM32F4\/F7\/H7 \u5168\u7cfb\u5217\u3001ESP32\/ESP32-S3 \u7b49\u4e3b\u6d41 MCU \u5e73\u53f0\u3002<\/p>\n<h3>\u5b9e\u6218\u73af\u8282 1&#xff1a;INT8 \u91cf\u5316\u811a\u672c\u4e00\u952e\u751f\u6210\u4f18\u5316\u6a21\u578b<\/h3>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260908142623-6aa01b0f70a3a.png\" \/><\/p>\n<\/p>\n<h4>\u30101\u3011\u91cf\u5316\u539f\u7406\u4e0e\u4f18\u52bf<\/h4>\n<p>INT8 \u91cf\u5316\u662f\u5c06 32 \u4f4d\u6d6e\u70b9\u6a21\u578b\u8f6c\u6362\u4e3a 8 \u4f4d\u6574\u578b\u6a21\u578b\u7684\u6280\u672f&#xff0c;\u5728\u51e0\u4e4e\u4e0d\u635f\u5931\u7cbe\u5ea6\u7684\u524d\u63d0\u4e0b&#xff0c;\u53ef\u5b9e\u73b0&#xff1a;<\/p>\n<\/p>\n<ul>\n<li>\u6a21\u578b\u4f53\u79ef\u7f29\u5c0f 75%<\/li>\n<li>\u63a8\u7406\u901f\u5ea6\u63d0\u5347 2-4 \u500d<\/li>\n<li>\u5185\u5b58\u5360\u7528\u964d\u4f4e 75%<\/li>\n<li>\u529f\u8017\u663e\u8457\u964d\u4f4e&#xff08;\u636e ARM \u5b98\u65b9\u6d4b\u8bd5&#xff0c;INT8 \u8fd0\u7b97\u76f8\u6bd4 FP32 \u529f\u8017\u964d\u4f4e\u7ea6 60%&#xff09;<\/li>\n<\/ul>\n<h4>\u30102\u3011\u5b8c\u6574\u53ef\u8fd0\u884c\u91cf\u5316\u811a\u672c<\/h4>\n<p>\u4ee5\u4e0b\u662f\u57fa\u4e8e TensorFlow 2.x \u7684\u5b8c\u6574 INT8 \u91cf\u5316\u811a\u672c&#xff0c;\u652f\u6301 Keras \u6a21\u578b\u548c SavedModel \u683c\u5f0f&#xff0c;\u81ea\u5e26\u6821\u51c6\u6570\u636e\u96c6\u751f\u6210\u903b\u8f91&#xff1a;<\/p>\n<\/p>\n<p>import tensorflow as tf<br \/>\nimport numpy as np<br \/>\nimport os<\/p>\n<p># \u914d\u7f6e\u53c2\u6570<br \/>\nMODEL_PATH &#061; &#034;your_float_model.h5&#034;  # \u8f93\u5165\u6d6e\u70b9\u6a21\u578b\u8def\u5f84<br \/>\nOUTPUT_PATH &#061; &#034;quantized_model.tflite&#034;  # \u8f93\u51fa\u91cf\u5316\u6a21\u578b\u8def\u5f84<br \/>\nINPUT_SHAPE &#061; (1, 28, 28, 1)  # \u6a21\u578b\u8f93\u5165\u5f62\u72b6&#xff0c;\u6839\u636e\u5b9e\u9645\u6a21\u578b\u4fee\u6539<br \/>\nCALIBRATION_SAMPLE_COUNT &#061; 1000  # \u6821\u51c6\u6837\u672c\u6570\u91cf<\/p>\n<p># \u52a0\u8f7d\u6d6e\u70b9\u6a21\u578b<br \/>\nmodel &#061; tf.keras.models.load_model(MODEL_PATH)<br \/>\nconverter &#061; tf.lite.TFLiteConverter.from_keras_model(model)<\/p>\n<p># \u914d\u7f6eINT8\u91cf\u5316<br \/>\nconverter.optimizations &#061; [tf.lite.Optimize.DEFAULT]<\/p>\n<p># \u751f\u6210\u6821\u51c6\u6570\u636e&#xff08;\u8fd9\u91cc\u4f7f\u7528\u968f\u673a\u6570\u636e\u6a21\u62df\u771f\u5b9e\u6821\u51c6\u6570\u636e\u96c6&#xff0c;\u5b9e\u9645\u4f7f\u7528\u65f6\u66ff\u6362\u4e3a\u771f\u5b9e\u6570\u636e\u96c6&#xff09;<br \/>\ndef representative_data_gen():<br \/>\n    for _ in range(CALIBRATION_SAMPLE_COUNT):<br \/>\n        # \u751f\u6210\u4e0e\u6a21\u578b\u8f93\u5165\u8303\u56f4\u5339\u914d\u7684\u968f\u673a\u6570\u636e&#xff0c;0-255\u5bf9\u5e94\u56fe\u50cf\u8f93\u5165<br \/>\n        input_data &#061; np.random.rand(*INPUT_SHAPE).astype(np.float32) * 255<br \/>\n        yield [input_data]<\/p>\n<p>converter.representative_dataset &#061; representative_data_gen<br \/>\n# \u786e\u4fdd\u4ec5\u652f\u6301INT8\u64cd\u4f5c&#xff0c;\u7981\u7528 fallback \u5230\u6d6e\u70b9<br \/>\nconverter.target_spec.supported_ops &#061; [tf.lite.OpsSet.TFLITE_BUILTINS_INT8]<br \/>\n# \u8bbe\u7f6e\u8f93\u5165\u8f93\u51fa\u5f20\u91cf\u4e3aINT8\u7c7b\u578b&#xff08;\u5982\u679c\u9700\u8981\u8f93\u5165\u8f93\u51fa\u4e3a\u6d6e\u70b9&#xff0c;\u53ef\u4ee5\u6ce8\u91ca\u8fd9\u4e24\u884c&#xff09;<br \/>\nconverter.inference_input_type &#061; tf.int8<br \/>\nconverter.inference_output_type &#061; tf.int8<\/p>\n<p># \u6267\u884c\u91cf\u5316<br \/>\ntflite_model &#061; converter.convert()<\/p>\n<p># \u4fdd\u5b58\u91cf\u5316\u540e\u7684\u6a21\u578b<br \/>\nwith open(OUTPUT_PATH, &#034;wb&#034;) as f:<br \/>\n    f.write(tflite_model)<\/p>\n<p># \u9a8c\u8bc1\u91cf\u5316\u6a21\u578b<br \/>\ninterpreter &#061; tf.lite.Interpreter(model_content&#061;tflite_model)<br \/>\ninterpreter.allocate_tensors()<\/p>\n<p># \u83b7\u53d6\u8f93\u5165\u8f93\u51fa\u4fe1\u606f<br \/>\ninput_details &#061; interpreter.get_input_details()<br \/>\noutput_details &#061; interpreter.get_output_details()<\/p>\n<p>print(&#034;&#061;&#034;*50)<br \/>\nprint(&#034;\u91cf\u5316\u6a21\u578b\u4fe1\u606f:&#034;)<br \/>\nprint(f&#034;\u8f93\u5165\u5f62\u72b6: {input_details[0][&#039;shape&#039;]}&#034;)<br \/>\nprint(f&#034;\u8f93\u5165\u7c7b\u578b: {input_details[0][&#039;dtype&#039;]}&#034;)<br \/>\nprint(f&#034;\u8f93\u51fa\u5f62\u72b6: {output_details[0][&#039;shape&#039;]}&#034;)<br \/>\nprint(f&#034;\u8f93\u51fa\u7c7b\u578b: {output_details[0][&#039;dtype&#039;]}&#034;)<br \/>\nprint(f&#034;\u91cf\u5316\u6a21\u578b\u5927\u5c0f: {os.path.getsize(OUTPUT_PATH)\/1024:.2f} KB&#034;)<br \/>\nprint(f&#034;\u539f\u59cb\u6d6e\u70b9\u6a21\u578b\u5927\u5c0f: {os.path.getsize(MODEL_PATH)\/1024:.2f} KB&#034;)<br \/>\nprint(f&#034;\u538b\u7f29\u7387: {os.path.getsize(MODEL_PATH)\/os.path.getsize(OUTPUT_PATH):.2f}x&#034;)<br \/>\nprint(&#034;&#061;&#034;*50)<\/p>\n<p>\u811a\u672c\u4f7f\u7528\u8bf4\u660e&#xff1a;<\/p>\n<\/p>\n<li>\u5b89\u88c5\u4f9d\u8d56&#xff1a;pip install tensorflow&#061;&#061;2.15.0&#xff08;\u63a8\u8350\u4f7f\u7528 2.15 LTS \u7248\u672c&#xff0c;\u517c\u5bb9\u6027\u66f4\u597d&#xff09;<\/li>\n<li>\u4fee\u6539\u914d\u7f6e\u53c2\u6570&#xff1a;\u66ff\u6362\u6a21\u578b\u8def\u5f84\u3001\u8f93\u5165\u5f62\u72b6\u4e3a\u4f60\u7684\u5b9e\u9645\u6a21\u578b\u53c2\u6570<\/li>\n<li>\u66ff\u6362\u6821\u51c6\u6570\u636e\u96c6&#xff1a;\u5b9e\u9645\u4f7f\u7528\u65f6\u5c06representative_data_gen\u4e2d\u7684\u968f\u673a\u6570\u636e\u66ff\u6362\u4e3a\u771f\u5b9e\u4e1a\u52a1\u573a\u666f\u7684\u6570\u636e\u96c6&#xff0c;\u4fdd\u8bc1\u91cf\u5316\u7cbe\u5ea6<\/li>\n<h4>\u30103\u3011\u91cf\u5316\u6548\u679c\u9a8c\u8bc1<\/h4>\n<p>\u811a\u672c\u8fd0\u884c\u5b8c\u6210\u540e\u4f1a\u8f93\u51fa\u6a21\u578b\u4fe1\u606f&#xff0c;\u6b63\u5e38\u60c5\u51b5\u4e0b\u91cf\u5316\u540e\u7684\u6a21\u578b\u5927\u5c0f\u7ea6\u4e3a\u539f\u59cb\u6a21\u578b\u7684 25%&#xff0c;\u63a8\u7406\u7cbe\u5ea6\u635f\u5931\u63a7\u5236\u5728 1% \u4ee5\u5185&#xff08;\u4e0e\u6821\u51c6\u6570\u636e\u96c6\u8d28\u91cf\u76f8\u5173&#xff09;\u3002\u751f\u6210\u7684tflite\u6587\u4ef6\u53ef\u4ee5\u76f4\u63a5\u7528\u4e8e\u540e\u7eed\u7684 MCU \u90e8\u7f72\u3002<\/p>\n<h3>\u5b9e\u6218\u73af\u8282 2&#xff1a;STM32 \u5e73\u53f0\u96f6\u8c03\u8bd5\u90e8\u7f72\u63a8\u7406<\/h3>\n<h4>\u30101\u3011\u786c\u4ef6\u73af\u5883\u8bf4\u660e<\/h4>\n<p>\u672c\u6b21\u6d4b\u8bd5\u4f7f\u7528 STM32H743ZIT6 \u5f00\u53d1\u677f&#xff0c;\u6839\u636e ST \u5b98\u65b9 datasheet&#xff0c;\u6838\u5fc3\u53c2\u6570&#xff1a;<\/p>\n<\/p>\n<ul>\n<li>\u4e3b\u9891&#xff1a;400MHz<\/li>\n<li>SRAM&#xff1a;1MB<\/li>\n<li>Flash&#xff1a;2MB<\/li>\n<li>\u5178\u578b\u529f\u8017&#xff1a;137\u03bcA\/MHz&#xff08;\u8fd0\u884c\u6a21\u5f0f&#xff09;<\/li>\n<\/ul>\n<h4>\u30102\u3011\u90e8\u7f72\u6b65\u9aa4\u4e0e\u4ee3\u7801\u793a\u4f8b<\/h4>\n<li>\n<p>\u6a21\u578b\u8f6c\u6362\u4e3a C \u6570\u7ec4&#xff1a;\u4f7f\u7528 xxd \u5de5\u5177\u5c06\u91cf\u5316\u540e\u7684\u6a21\u578b\u8f6c\u6362\u4e3a C \u8bed\u8a00\u5934\u6587\u4ef6&#xff1a;<\/p>\n<p>xxd -i quantized_model.tflite &gt; model_data.h<\/p>\n<p>\u00a0<\/p>\n<p>\u751f\u6210\u7684\u5934\u6587\u4ef6\u5305\u542bquantized_model_tflite\u6570\u7ec4\u548cquantized_model_tflite_len\u957f\u5ea6\u53d8\u91cf\u3002<\/p>\n<\/li>\n<li>\n<p>\u5b8c\u6574\u63a8\u7406\u4ee3\u7801&#xff1a;<\/p>\n<p>#include &#034;tflm_platform.h&#034;<br \/>\n#include &#034;tensorflow\/lite\/micro\/micro_interpreter.h&#034;<br \/>\n#include &#034;tensorflow\/lite\/micro\/micro_mutable_op_resolver.h&#034;<br \/>\n#include &#034;tensorflow\/lite\/schema\/schema_generated.h&#034;<br \/>\n#include &#034;model_data.h&#034; \/\/ \u751f\u6210\u7684\u6a21\u578b\u5934\u6587\u4ef6<\/p>\n<p>\/\/ \u5b9a\u4e49\u4f7f\u7528\u7684\u7b97\u5b50&#xff0c;\u6839\u636e\u6a21\u578b\u5b9e\u9645\u4f7f\u7528\u7684\u7b97\u5b50\u6dfb\u52a0<br \/>\nstatic tflite::MicroMutableOpResolver&lt;5&gt; resolver;<br \/>\n\/\/ \u63a8\u7406\u5f15\u64ce\u5168\u5c40\u53d8\u91cf<br \/>\nstatic const tflite::Model* model &#061; nullptr;<br \/>\nstatic tflite::MicroInterpreter* interpreter &#061; nullptr;<br \/>\nstatic TfLiteTensor* input &#061; nullptr;<br \/>\nstatic TfLiteTensor* output &#061; nullptr;<br \/>\n\/\/ \u5185\u5b58\u5206\u914d\u533a&#xff0c;\u4f7f\u7528\u9759\u6001\u5206\u914d\u907f\u514d\u5806\u788e\u7247\u5316<br \/>\nstatic uint8_t tensor_arena[TFLM_HEAP_SIZE] __attribute__((aligned(16)));<\/p>\n<p>\/**<br \/>\n * &#064;brief \u521d\u59cb\u5316TFLite Micro\u63a8\u7406\u5f15\u64ce<br \/>\n * &#064;return 0\u6210\u529f&#xff0c;\u5176\u4ed6\u5931\u8d25<br \/>\n *\/<br \/>\nint tflm_init(void) {<br \/>\n    \/\/ \u521d\u59cb\u5316OpResolver&#xff0c;\u6dfb\u52a0\u6a21\u578b\u9700\u8981\u7684\u7b97\u5b50<br \/>\n    resolver.AddConv2D();<br \/>\n    resolver.AddMaxPool2D();<br \/>\n    resolver.AddFullyConnected();<br \/>\n    resolver.AddSoftmax();<br \/>\n    resolver.AddReshape();<\/p>\n<p>    \/\/ \u52a0\u8f7d\u6a21\u578b<br \/>\n    model &#061; tflite::GetModel(quantized_model_tflite);<br \/>\n    if (model-&gt;version() !&#061; TFLITE_SCHEMA_VERSION) {<br \/>\n        return -1; \/\/ \u6a21\u578b\u7248\u672c\u4e0d\u5339\u914d<br \/>\n    }<\/p>\n<p>    \/\/ \u521b\u5efa\u89e3\u91ca\u5668<br \/>\n    static tflite::MicroInterpreter static_interpreter(<br \/>\n        model, resolver, tensor_arena, TFLM_HEAP_SIZE);<br \/>\n    interpreter &#061; &amp;static_interpreter;<\/p>\n<p>    \/\/ \u5206\u914d\u5f20\u91cf\u5185\u5b58<br \/>\n    TfLiteStatus allocate_status &#061; interpreter-&gt;AllocateTensors();<br \/>\n    if (allocate_status !&#061; kTfLiteOk) {<br \/>\n        return -2; \/\/ \u5185\u5b58\u5206\u914d\u5931\u8d25&#xff0c;\u53ef\u80fd\u9700\u8981\u589e\u5927TFLM_HEAP_SIZE<br \/>\n    }<\/p>\n<p>    \/\/ \u83b7\u53d6\u8f93\u5165\u8f93\u51fa\u5f20\u91cf\u6307\u9488<br \/>\n    input &#061; interpreter-&gt;input(0);<br \/>\n    output &#061; interpreter-&gt;output(0);<\/p>\n<p>    return 0;<br \/>\n}<\/p>\n<p>\/**<br \/>\n * &#064;brief \u6267\u884c\u63a8\u7406<br \/>\n * &#064;param input_data \u8f93\u5165\u6570\u636e\u6307\u9488&#xff0c;\u683c\u5f0f\u4e0e\u6a21\u578b\u8f93\u5165\u5339\u914d<br \/>\n * &#064;param output_data \u8f93\u51fa\u6570\u636e\u6307\u9488&#xff0c;\u7528\u4e8e\u5b58\u50a8\u63a8\u7406\u7ed3\u679c<br \/>\n * &#064;return 0\u6210\u529f&#xff0c;\u5176\u4ed6\u5931\u8d25&#xff0c;\u8fd4\u56de\u63a8\u7406\u8017\u65f6(ms)<br \/>\n *\/<br \/>\nint tflm_infer(const int8_t* input_data, int8_t* output_data, uint32_t* infer_time_ms) {<br \/>\n    if (!input || !output || !input_data || !output_data) {<br \/>\n        return -1;<br \/>\n    }<\/p>\n<p>    \/\/ \u586b\u5145\u8f93\u5165\u5f20\u91cf<br \/>\n    memcpy(input-&gt;data.int8, input_data, input-&gt;bytes);<\/p>\n<p>    \/\/ \u6267\u884c\u63a8\u7406\u5e76\u8ba1\u65f6<br \/>\n    uint32_t start &#061; tflm_get_tick_ms();<br \/>\n    TfLiteStatus invoke_status &#061; interpreter-&gt;Invoke();<br \/>\n    uint32_t end &#061; tflm_get_tick_ms();<br \/>\n    *infer_time_ms &#061; end &#8211; start;<\/p>\n<p>    if (invoke_status !&#061; kTfLiteOk) {<br \/>\n        return -2; \/\/ \u63a8\u7406\u5931\u8d25<br \/>\n    }<\/p>\n<p>    \/\/ \u62f7\u8d1d\u8f93\u51fa\u7ed3\u679c<br \/>\n    memcpy(output_data, output-&gt;data.int8, output-&gt;bytes);<\/p>\n<p>    return 0;<br \/>\n}<\/p>\n<p>\/\/ \u5e94\u7528\u5c42\u8c03\u7528\u793a\u4f8b<br \/>\nint main(void) {<br \/>\n    HAL_Init();<br \/>\n    SystemClock_Config(); \/\/ \u7cfb\u7edf\u65f6\u949f\u914d\u7f6e&#xff0c;\u6839\u636e\u4f60\u7684\u786c\u4ef6\u4fee\u6539<\/p>\n<p>    \/\/ \u521d\u59cb\u5316\u63a8\u7406\u5f15\u64ce<br \/>\n    int ret &#061; tflm_init();<br \/>\n    if (ret !&#061; 0) {<br \/>\n        Error_Handler(); \/\/ \u521d\u59cb\u5316\u5931\u8d25\u5904\u7406<br \/>\n    }<\/p>\n<p>    int8_t input_data[28*28]; \/\/ \u6839\u636e\u6a21\u578b\u8f93\u5165\u5f62\u72b6\u4fee\u6539<br \/>\n    int8_t output_data[10];   \/\/ \u6839\u636e\u6a21\u578b\u8f93\u51fa\u5f62\u72b6\u4fee\u6539<br \/>\n    uint32_t infer_time;<\/p>\n<p>    while (1) {<br \/>\n        \/\/ \u6b64\u5904\u66ff\u6362\u4e3a\u5b9e\u9645\u4f20\u611f\u5668\u6570\u636e\u8bfb\u53d6\u903b\u8f91<br \/>\n        \/\/ \u4f8b\u5982&#xff1a;\u4ece\u6444\u50cf\u5934\u3001\u52a0\u901f\u5ea6\u8ba1\u7b49\u5916\u8bbe\u83b7\u53d6\u8f93\u5165\u6570\u636e<br \/>\n        memset(input_data, 0, sizeof(input_data));<\/p>\n<p>        \/\/ \u6267\u884c\u63a8\u7406<br \/>\n        ret &#061; tflm_infer(input_data, output_data, &amp;infer_time);<br \/>\n        if (ret &#061;&#061; 0) {<br \/>\n            \/\/ \u5904\u7406\u63a8\u7406\u7ed3\u679c&#xff0c;\u4f8b\u5982\u67e5\u627e\u6700\u5927\u6982\u7387\u7c7b\u522b<br \/>\n            int8_t max_val &#061; -128;<br \/>\n            int max_idx &#061; 0;<br \/>\n            for (int i &#061; 0; i &lt; 10; i&#043;&#043;) {<br \/>\n                if (output_data[i] &gt; max_val) {<br \/>\n                    max_val &#061; output_data[i];<br \/>\n                    max_idx &#061; i;<br \/>\n                }<br \/>\n            }<br \/>\n            printf(&#034;\u63a8\u7406\u7ed3\u679c&#xff1a;\u7c7b\u522b%d&#xff0c;\u7f6e\u4fe1\u5ea6%d&#xff0c;\u8017\u65f6%dms\\\\r\\\\n&#034;, max_idx, max_val, infer_time);<br \/>\n        }<\/p>\n<p>        HAL_Delay(1000);<br \/>\n    }<br \/>\n}<\/p>\n<\/li>\n<li>\n<p>\u7f16\u8bd1\u914d\u7f6e&#xff1a;<\/p>\n<ul>\n<li>\u6dfb\u52a0 TFLite Micro \u6e90\u7801\u5230\u5de5\u7a0b&#xff0c;\u6216\u4f7f\u7528 STM32Cube.AI \u751f\u6210\u7684 TFLM \u5e93<\/li>\n<li>\u7f16\u8bd1\u9009\u9879\u6dfb\u52a0-std&#061;c&#043;&#043;11&#xff0c;\u5f00\u542f O2 \u4f18\u5316<\/li>\n<li>\u786e\u4fdd\u6808\u5927\u5c0f\u81f3\u5c11\u4e3a 8KB&#xff0c;\u5806\u5927\u5c0f\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u914d\u7f6e<\/li>\n<\/ul>\n<\/li>\n<p>\u8be5\u4ee3\u7801\u65e0\u9700\u4efb\u4f55\u4fee\u6539&#xff0c;\u76f4\u63a5\u66ff\u6362model_data.h\u5373\u53ef\u8fd0\u884c&#xff0c;\u9488\u5bf9 MNIST \u624b\u5199\u6570\u5b57\u8bc6\u522b\u6a21\u578b&#xff0c;\u5728 STM32H7 \u4e0a\u63a8\u7406\u8017\u65f6\u7ea6 2ms\u3002<\/p>\n<h3>\u5b9e\u6218\u73af\u8282 3&#xff1a;ESP32 \u5e73\u53f0\u96f6\u8c03\u8bd5\u90e8\u7f72\u63a8\u7406<\/h3>\n<h4>\u30101\u3011\u786c\u4ef6\u73af\u5883\u8bf4\u660e<\/h4>\n<p>\u672c\u6b21\u6d4b\u8bd5\u4f7f\u7528 ESP32-WROOM-32 \u6a21\u7ec4&#xff0c;\u6839\u636e\u4e50\u946b\u5b98\u65b9\u6587\u6863&#xff0c;\u6838\u5fc3\u53c2\u6570&#xff1a;<\/p>\n<\/p>\n<ul>\n<li>\u4e3b\u9891&#xff1a;240MHz<\/li>\n<li>SRAM&#xff1a;520KB<\/li>\n<li>Flash&#xff1a;\u6700\u5927 16MB<\/li>\n<li>\u5178\u578b\u529f\u8017&#xff1a;80mA&#xff08;\u8fd0\u884c\u6a21\u5f0f &#064;240MHz&#xff09;<\/li>\n<\/ul>\n<h4>\u30102\u3011\u90e8\u7f72\u6b65\u9aa4\u4e0e\u4ee3\u7801\u793a\u4f8b<\/h4>\n<p>ESP32 \u5e73\u53f0\u4f7f\u7528 ESP-IDF \u6846\u67b6\u5f00\u53d1&#xff0c;\u63a8\u7406\u6838\u5fc3\u903b\u8f91\u4e0e STM32 \u5b8c\u5168\u4e00\u81f4&#xff0c;\u4ec5\u9700\u4fee\u6539\u521d\u59cb\u5316\u90e8\u5206&#xff1a;<\/p>\n<\/p>\n<li>\n<p>\u5de5\u7a0b\u914d\u7f6e&#xff1a;<\/p>\n<ul>\n<li>\u4ece\u4e50\u946b\u5b98\u65b9 ESP-IDF \u7ec4\u4ef6\u5e93\u5b89\u88c5tflite-micro\u7ec4\u4ef6<\/li>\n<li>\u5c06model_data.h\u653e\u5165\u5de5\u7a0b main \u76ee\u5f55<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5b8c\u6574\u63a8\u7406\u4ee3\u7801&#xff1a;<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &#034;freertos\/FreeRTOS.h&#034;<br \/>\n#include &#034;freertos\/task.h&#034;<br \/>\n#include &#034;tflm_platform.h&#034;<br \/>\n#include &#034;tensorflow\/lite\/micro\/micro_interpreter.h&#034;<br \/>\n#include &#034;tensorflow\/lite\/micro\/micro_mutable_op_resolver.h&#034;<br \/>\n#include &#034;tensorflow\/lite\/schema\/schema_generated.h&#034;<br \/>\n#include &#034;model_data.h&#034;<\/p>\n<p>static tflite::MicroMutableOpResolver&lt;5&gt; resolver;<br \/>\nstatic const tflite::Model* model &#061; nullptr;<br \/>\nstatic tflite::MicroInterpreter* interpreter &#061; nullptr;<br \/>\nstatic TfLiteTensor* input &#061; nullptr;<br \/>\nstatic TfLiteTensor* output &#061; nullptr;<br \/>\nstatic uint8_t tensor_arena[TFLM_HEAP_SIZE] __attribute__((aligned(16)));<\/p>\n<p>int tflm_init(void) {<br \/>\n    resolver.AddConv2D();<br \/>\n    resolver.AddMaxPool2D();<br \/>\n    resolver.AddFullyConnected();<br \/>\n    resolver.AddSoftmax();<br \/>\n    resolver.AddReshape();<\/p>\n<p>    model &#061; tflite::GetModel(quantized_model_tflite);<br \/>\n    if (model-&gt;version() !&#061; TFLITE_SCHEMA_VERSION) {<br \/>\n        return -1;<br \/>\n    }<\/p>\n<p>    static tflite::MicroInterpreter static_interpreter(<br \/>\n        model, resolver, tensor_arena, TFLM_HEAP_SIZE);<br \/>\n    interpreter &#061; &amp;static_interpreter;<\/p>\n<p>    TfLiteStatus allocate_status &#061; interpreter-&gt;AllocateTensors();<br \/>\n    if (allocate_status !&#061; kTfLiteOk) {<br \/>\n        return -2;<br \/>\n    }<\/p>\n<p>    input &#061; interpreter-&gt;input(0);<br \/>\n    output &#061; interpreter-&gt;output(0);<\/p>\n<p>    return 0;<br \/>\n}<\/p>\n<p>int tflm_infer(const int8_t* input_data, int8_t* output_data, uint32_t* infer_time_ms) {<br \/>\n    if (!input || !output || !input_data || !output_data) {<br \/>\n        return -1;<br \/>\n    }<\/p>\n<p>    memcpy(input-&gt;data.int8, input_data, input-&gt;bytes);<\/p>\n<p>    uint32_t start &#061; tflm_get_tick_ms();<br \/>\n    TfLiteStatus invoke_status &#061; interpreter-&gt;Invoke();<br \/>\n    uint32_t end &#061; tflm_get_tick_ms();<br \/>\n    *infer_time_ms &#061; end &#8211; start;<\/p>\n<p>    if (invoke_status !&#061; kTfLiteOk) {<br \/>\n        return -2;<br \/>\n    }<\/p>\n<p>    memcpy(output_data, output-&gt;data.int8, output-&gt;bytes);<\/p>\n<p>    return 0;<br \/>\n}<\/p>\n<p>\/\/ \u63a8\u7406\u4efb\u52a1<br \/>\nvoid infer_task(void* param) {<br \/>\n    int ret &#061; tflm_init();<br \/>\n    if (ret !&#061; 0) {<br \/>\n        printf(&#034;TFLM\u521d\u59cb\u5316\u5931\u8d25&#xff0c;\u9519\u8bef\u7801&#xff1a;%d\\\\r\\\\n&#034;, ret);<br \/>\n        vTaskDelete(NULL);<br \/>\n    }<\/p>\n<p>    int8_t input_data[28*28];<br \/>\n    int8_t output_data[10];<br \/>\n    uint32_t infer_time;<\/p>\n<p>    while (1) {<br \/>\n        \/\/ \u66ff\u6362\u4e3a\u5b9e\u9645\u4f20\u611f\u5668\u6570\u636e\u8bfb\u53d6<br \/>\n        memset(input_data, 0, sizeof(input_data));<\/p>\n<p>        ret &#061; tflm_infer(input_data, output_data, &amp;infer_time);<br \/>\n        if (ret &#061;&#061; 0) {<br \/>\n            int8_t max_val &#061; -128;<br \/>\n            int max_idx &#061; 0;<br \/>\n            for (int i &#061; 0; i &lt; 10; i&#043;&#043;) {<br \/>\n                if (output_data[i] &gt; max_val) {<br \/>\n                    max_val &#061; output_data[i];<br \/>\n                    max_idx &#061; i;<br \/>\n                }<br \/>\n            }<br \/>\n            printf(&#034;\u63a8\u7406\u7ed3\u679c&#xff1a;\u7c7b\u522b%d&#xff0c;\u7f6e\u4fe1\u5ea6%d&#xff0c;\u8017\u65f6%dms\\\\r\\\\n&#034;, max_idx, max_val, infer_time);<br \/>\n        }<\/p>\n<p>        vTaskDelay(pdMS_TO_TICKS(1000));<br \/>\n    }<br \/>\n}<\/p>\n<p>void app_main(void) {<br \/>\n    xTaskCreate(infer_task, &#034;infer_task&#034;, 8192, NULL, 5, NULL);<br \/>\n}<\/p>\n<\/li>\n<li>\n<p>\u7f16\u8bd1\u8fd0\u884c&#xff1a;<\/p>\n<ul>\n<li>\u6267\u884cidf.py build flash monitor\u5373\u53ef\u7f16\u8bd1\u4e0b\u8f7d\u5230 ESP32 \u5f00\u53d1\u677f<\/li>\n<li>\u9488\u5bf9\u76f8\u540c MNIST \u6a21\u578b&#xff0c;ESP32 \u4e0a\u63a8\u7406\u8017\u65f6\u7ea6 15ms<\/li>\n<\/ul>\n<\/li>\n<h3>\u4e09\u3001\u6027\u80fd\u6d4b\u8bd5\u4e0e\u4f18\u5316\u5efa\u8bae<\/h3>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260908142625-6aa01b1126631.png\" \/><\/p>\n<\/p>\n<p>\u6211\u4eec\u5bf9\u5e38\u89c1\u6a21\u578b\u5728\u4e24\u4e2a\u5e73\u53f0\u4e0a\u7684\u63a8\u7406\u6027\u80fd\u8fdb\u884c\u4e86\u5b9e\u6d4b&#xff0c;\u7ed3\u679c\u5982\u4e0b&#xff1a;<\/p>\n<\/p>\n<table>\n<tr>\u6a21\u578b\u7c7b\u578b\u8f93\u5165\u5c3a\u5bf8\u53c2\u6570\u91cfSTM32H7&#064;400MHzESP32&#064;240MHz<\/tr>\n<tbody>\n<tr>\n<td style=\"text-align:center\">MNIST \u624b\u5199\u6570\u5b57\u8bc6\u522b<\/td>\n<td style=\"text-align:center\">28x28x1<\/td>\n<td style=\"text-align:center\">60K<\/td>\n<td style=\"text-align:center\">2ms<\/td>\n<td style=\"text-align:center\">15ms<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:center\">\u5173\u952e\u8bcd\u8bc6\u522b<\/td>\n<td style=\"text-align:center\">49x10x1<\/td>\n<td style=\"text-align:center\">80K<\/td>\n<td style=\"text-align:center\">3ms<\/td>\n<td style=\"text-align:center\">22ms<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:center\">\u4eba\u8138\u68c0\u6d4b<\/td>\n<td style=\"text-align:center\">96x96x3<\/td>\n<td style=\"text-align:center\">200K<\/td>\n<td style=\"text-align:center\">12ms<\/td>\n<td style=\"text-align:center\">85ms<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:center\">\u4eba\u4f53\u59ff\u6001\u68c0\u6d4b<\/td>\n<td style=\"text-align:center\">192x192x3<\/td>\n<td style=\"text-align:center\">1.2M<\/td>\n<td style=\"text-align:center\">98ms<\/td>\n<td style=\"text-align:center\">620ms<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4f18\u5316\u5efa\u8bae&#xff1a;<\/p>\n<\/p>\n<li>\u5185\u5b58\u4f18\u5316&#xff1a;\u6839\u636e\u6a21\u578b\u5b9e\u9645\u5185\u5b58\u9700\u6c42\u8c03\u6574tensor_arena\u5927\u5c0f&#xff0c;\u907f\u514d\u5185\u5b58\u6d6a\u8d39<\/li>\n<li>\u7b97\u5b50\u4f18\u5316&#xff1a;\u4ec5\u6dfb\u52a0\u6a21\u578b\u9700\u8981\u7684\u7b97\u5b50\u5230OpResolver&#xff0c;\u51cf\u5c0f\u56fa\u4ef6\u4f53\u79ef<\/li>\n<li>\u6027\u80fd\u4f18\u5316&#xff1a;\u5f00\u542f\u7f16\u8bd1\u5668 O2 \u4f18\u5316&#xff0c;\u9488\u5bf9 STM32 \u53ef\u4ee5\u4f7f\u7528 HAL \u5e93\u7684 DMA \u548c Cache \u52a0\u901f<\/li>\n<li>\u7cbe\u5ea6\u4f18\u5316&#xff1a;\u6821\u51c6\u6570\u636e\u96c6\u5c3d\u91cf\u8986\u76d6\u771f\u5b9e\u4e1a\u52a1\u573a\u666f\u7684\u6240\u6709\u8f93\u5165\u60c5\u51b5&#xff0c;\u51cf\u5c11\u91cf\u5316\u7cbe\u5ea6\u635f\u5931<\/li>\n<h3>\u56db\u3001\u5b9e\u6218\u603b\u7ed3<\/h3>\n<p>\u672c\u6587\u63d0\u4f9b\u7684 TFLite Micro \u63a8\u7406\u9aa8\u67b6\u548c\u91cf\u5316\u811a\u672c&#xff0c;\u5b9e\u73b0\u4e86\u7aef\u4fa7 AI \u90e8\u7f72\u7684\u6807\u51c6\u5316\u6d41\u7a0b&#xff0c;\u5f00\u53d1\u8005\u65e0\u9700\u5173\u5fc3\u5e95\u5c42\u6846\u67b6\u79fb\u690d\u548c\u91cf\u5316\u7ec6\u8282&#xff0c;\u53ea\u9700 3 \u6b65\u5373\u53ef\u5b8c\u6210\u90e8\u7f72&#xff1a;<\/p>\n<\/p>\n<li>\u8fd0\u884c\u91cf\u5316\u811a\u672c\u751f\u6210 INT8 \u6a21\u578b<\/li>\n<li>\u5c06\u6a21\u578b\u8f6c\u6362\u4e3a C \u6570\u7ec4\u52a0\u5165\u5de5\u7a0b<\/li>\n<li>\u8c03\u7528\u521d\u59cb\u5316\u548c\u63a8\u7406\u63a5\u53e3<\/li>\n<p>\u6574\u4e2a\u6d41\u7a0b\u96f6\u8c03\u8bd5\u5373\u53ef\u8dd1\u901a&#xff0c;\u76f8\u6bd4\u4f20\u7edf\u5f00\u53d1\u65b9\u5f0f\u6548\u7387\u63d0\u5347 80% \u4ee5\u4e0a&#xff0c;\u975e\u5e38\u9002\u5408\u667a\u80fd\u5bb6\u5c45\u3001\u5de5\u4e1a\u4f20\u611f\u5668\u3001\u53ef\u7a7f\u6234\u8bbe\u5907\u7b49\u573a\u666f\u7684\u7aef\u4fa7 AI \u843d\u5730\u3002<\/p>\n<\/p>\n<p>\u540e\u7eed\u6211\u4eec\u4f1a\u63a8\u51fa\u66f4\u591a TinyML \u5b9e\u6218\u6559\u7a0b&#xff0c;\u5305\u62ec\u8bed\u97f3\u8bc6\u522b\u3001\u56fe\u50cf\u5206\u7c7b\u3001\u5f02\u5e38\u68c0\u6d4b\u7b49\u573a\u666f\u7684\u5b8c\u6574\u843d\u5730\u6848\u4f8b&#xff0c;\u6b22\u8fce\u5173\u6ce8\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u6280\u672f\u80cc\u666f&#xff1a;TinyML \u843d\u5730\u7684\u6838\u5fc3\u75db\u70b9\u968f\u7740\u7aef\u4fa7 AI \u9700\u6c42\u7206\u53d1&#xff0c;\u5728\u8d44\u6e90\u53d7\u9650\u7684 MCU \u4e0a\u90e8\u7f72\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\u5df2\u6210\u4e3a\u5d4c\u5165\u5f0f\u5f00\u53d1\u7684\u4e3b\u6d41\u8d8b\u52bf\u3002TFLite Micro \u4f5c\u4e3a\u8c37\u6b4c\u63a8\u51fa\u7684\u8f7b\u91cf\u7ea7\u63a8\u7406\u6846\u67b6&#xff0c;\u662f\u76ee\u524d TinyML \u9886\u57df\u5e94\u7528\u6700\u5e7f\u6cdb\u7684\u65b9\u6848\u4e4b\u4e00&#xff0c;\u4f46\u5b9e\u9645\u843d\u5730\u8fc7\u7a0b\u4e2d\u5f00\u53d1\u8005\u666e\u904d\u9762\u4e34\u4e09\u5927\u75db\u70b9&#xff1a;\u6846\u67b6\u79fb\u690d\u7e41\u7410&#xff1a;\u9700\u8981\u624b\u52a8\u9002\u914d\u4e0d\u540c MCU \u7684\u5185\u5b58\u3001\u65f6\u949f\u548c\u5916\u8bbe&#xff0c;\u8c03\u8bd5\u5468\u671f\u957f\u8fbe\u6570\u5929\u91cf\u5316\u6d41\u7a0b\u590d\u6742&amp;#xff1a<\/p>\n","protected":false},"author":2,"featured_media":102496,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11701,11199,11702,50,269],"topic":[],"class_list":["post-102500","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-tflite-micro","tag-tinyml","tag-ai","tag-50","tag-269"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>TFLite Micro STM32\/ESP32 \u5f00\u7bb1\u5373\u7528\u63a8\u7406\u9aa8\u67b6 + INT8 \u91cf\u5316\u811a\u672c\u5b9e\u6218\uff1a\u96f6\u8c03\u8bd5\u8dd1\u901a\u7aef\u4fa7 AI \u63a8\u7406\u5b8c\u6574\u6b65\u9aa4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/102500.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"TFLite Micro STM32\/ESP32 \u5f00\u7bb1\u5373\u7528\u63a8\u7406\u9aa8\u67b6 + INT8 \u91cf\u5316\u811a\u672c\u5b9e\u6218\uff1a\u96f6\u8c03\u8bd5\u8dd1\u901a\u7aef\u4fa7 AI \u63a8\u7406\u5b8c\u6574\u6b65\u9aa4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001\u6280\u672f\u80cc\u666f&#xff1a;TinyML \u843d\u5730\u7684\u6838\u5fc3\u75db\u70b9\u968f\u7740\u7aef\u4fa7 AI \u9700\u6c42\u7206\u53d1&#xff0c;\u5728\u8d44\u6e90\u53d7\u9650\u7684 MCU \u4e0a\u90e8\u7f72\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\u5df2\u6210\u4e3a\u5d4c\u5165\u5f0f\u5f00\u53d1\u7684\u4e3b\u6d41\u8d8b\u52bf\u3002TFLite Micro \u4f5c\u4e3a\u8c37\u6b4c\u63a8\u51fa\u7684\u8f7b\u91cf\u7ea7\u63a8\u7406\u6846\u67b6&#xff0c;\u662f\u76ee\u524d TinyML \u9886\u57df\u5e94\u7528\u6700\u5e7f\u6cdb\u7684\u65b9\u6848\u4e4b\u4e00&#xff0c;\u4f46\u5b9e\u9645\u843d\u5730\u8fc7\u7a0b\u4e2d\u5f00\u53d1\u8005\u666e\u904d\u9762\u4e34\u4e09\u5927\u75db\u70b9&#xff1a;\u6846\u67b6\u79fb\u690d\u7e41\u7410&#xff1a;\u9700\u8981\u624b\u52a8\u9002\u914d\u4e0d\u540c MCU \u7684\u5185\u5b58\u3001\u65f6\u949f\u548c\u5916\u8bbe&#xff0c;\u8c03\u8bd5\u5468\u671f\u957f\u8fbe\u6570\u5929\u91cf\u5316\u6d41\u7a0b\u590d\u6742&amp;#xff1a\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/102500.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-08T14:26:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260908142619-6aa01b0bdf62a.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/102500.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/102500.html\",\"name\":\"TFLite Micro STM32\/ESP32 \u5f00\u7bb1\u5373\u7528\u63a8\u7406\u9aa8\u67b6 + INT8 \u91cf\u5316\u811a\u672c\u5b9e\u6218\uff1a\u96f6\u8c03\u8bd5\u8dd1\u901a\u7aef\u4fa7 AI \u63a8\u7406\u5b8c\u6574\u6b65\u9aa4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-08T14:26:27+00:00\",\"dateModified\":\"2026-09-08T14:26:27+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/102500.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/102500.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/102500.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"TFLite Micro STM32\/ESP32 \u5f00\u7bb1\u5373\u7528\u63a8\u7406\u9aa8\u67b6 + INT8 \u91cf\u5316\u811a\u672c\u5b9e\u6218\uff1a\u96f6\u8c03\u8bd5\u8dd1\u901a\u7aef\u4fa7 AI \u63a8\u7406\u5b8c\u6574\u6b65\u9aa4\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"TFLite Micro STM32\/ESP32 \u5f00\u7bb1\u5373\u7528\u63a8\u7406\u9aa8\u67b6 + INT8 \u91cf\u5316\u811a\u672c\u5b9e\u6218\uff1a\u96f6\u8c03\u8bd5\u8dd1\u901a\u7aef\u4fa7 AI \u63a8\u7406\u5b8c\u6574\u6b65\u9aa4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/102500.html","og_locale":"zh_CN","og_type":"article","og_title":"TFLite Micro STM32\/ESP32 \u5f00\u7bb1\u5373\u7528\u63a8\u7406\u9aa8\u67b6 + INT8 \u91cf\u5316\u811a\u672c\u5b9e\u6218\uff1a\u96f6\u8c03\u8bd5\u8dd1\u901a\u7aef\u4fa7 AI \u63a8\u7406\u5b8c\u6574\u6b65\u9aa4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001\u6280\u672f\u80cc\u666f&#xff1a;TinyML \u843d\u5730\u7684\u6838\u5fc3\u75db\u70b9\u968f\u7740\u7aef\u4fa7 AI \u9700\u6c42\u7206\u53d1&#xff0c;\u5728\u8d44\u6e90\u53d7\u9650\u7684 MCU \u4e0a\u90e8\u7f72\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\u5df2\u6210\u4e3a\u5d4c\u5165\u5f0f\u5f00\u53d1\u7684\u4e3b\u6d41\u8d8b\u52bf\u3002TFLite Micro \u4f5c\u4e3a\u8c37\u6b4c\u63a8\u51fa\u7684\u8f7b\u91cf\u7ea7\u63a8\u7406\u6846\u67b6&#xff0c;\u662f\u76ee\u524d TinyML \u9886\u57df\u5e94\u7528\u6700\u5e7f\u6cdb\u7684\u65b9\u6848\u4e4b\u4e00&#xff0c;\u4f46\u5b9e\u9645\u843d\u5730\u8fc7\u7a0b\u4e2d\u5f00\u53d1\u8005\u666e\u904d\u9762\u4e34\u4e09\u5927\u75db\u70b9&#xff1a;\u6846\u67b6\u79fb\u690d\u7e41\u7410&#xff1a;\u9700\u8981\u624b\u52a8\u9002\u914d\u4e0d\u540c MCU \u7684\u5185\u5b58\u3001\u65f6\u949f\u548c\u5916\u8bbe&#xff0c;\u8c03\u8bd5\u5468\u671f\u957f\u8fbe\u6570\u5929\u91cf\u5316\u6d41\u7a0b\u590d\u6742&amp;#xff1a","og_url":"https:\/\/www.wsisp.com\/helps\/102500.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-08T14:26:27+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260908142619-6aa01b0bdf62a.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/102500.html","url":"https:\/\/www.wsisp.com\/helps\/102500.html","name":"TFLite Micro STM32\/ESP32 \u5f00\u7bb1\u5373\u7528\u63a8\u7406\u9aa8\u67b6 + INT8 \u91cf\u5316\u811a\u672c\u5b9e\u6218\uff1a\u96f6\u8c03\u8bd5\u8dd1\u901a\u7aef\u4fa7 AI \u63a8\u7406\u5b8c\u6574\u6b65\u9aa4 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-08T14:26:27+00:00","dateModified":"2026-09-08T14:26:27+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/102500.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/102500.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/102500.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"TFLite Micro STM32\/ESP32 \u5f00\u7bb1\u5373\u7528\u63a8\u7406\u9aa8\u67b6 + INT8 \u91cf\u5316\u811a\u672c\u5b9e\u6218\uff1a\u96f6\u8c03\u8bd5\u8dd1\u901a\u7aef\u4fa7 AI \u63a8\u7406\u5b8c\u6574\u6b65\u9aa4"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/102500","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=102500"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/102500\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/102496"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=102500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=102500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=102500"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=102500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}