首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >由于Adafruit_Tensorflow_Lite库中缺少文件,无法在adafruit电路操场蓝鳍金枪鱼上编译tensorflow lite示例

由于Adafruit_Tensorflow_Lite库中缺少文件,无法在adafruit电路操场蓝鳍金枪鱼上编译tensorflow lite示例
EN

Stack Overflow用户
提问于 2022-11-17 18:35:47
回答 1查看 21关注 0票数 0
  • 我无法在adafruit网站上编译hello_world_arcadamicro_speech_arcada在我的电路操场蓝鳍金枪鱼微控制器上找到这里的例子:

  • 正如站点中提到的那样,我安装了Adafruit_Tensorflow_Lite库,但是事实证明,示例无法编译,因为它们有许多丢失的文件。所以我下载了这个tensorflow git集线器存储库,然后将丢失的文件转移到Adafruit_Tensorflow_Lite库中。
  • 我现在面临着丢失文件的错误:am_mcu_apollo.h am_bsp.h am_util.h,我无法在回购或谷歌上找到这些文件。[注意:我在这个存储库中找到了am_bsp.h文件,但它仍然没有编译。
  • 可以帮助我找到这些文件的位置或者编译adafruit网站中提到的示例代码吗?

当使用Arduino编译时,错误显示在下面缺少的文件am_bsp.h的图中:

  • 我的代码如下所示:
代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
#include <TensorFlowLite.h>
#include "Adafruit_TFLite.h"
#include "Adafruit_Arcada.h"

#include "output_handler.h"
#include "sine_model_data.h"

// Create an area of memory to use for input, output, and intermediate arrays.
// Finding the minimum value for your model may require some trial and error.
const int kTensorAreaSize  (2 * 1024);

// This constant represents the range of x values our model was trained on,
// which is from 0 to (2 * Pi). We approximate Pi to avoid requiring additional
// libraries.
const float kXrange = 2.f * 3.14159265359f;

// Will need tuning for your chipset
const int kInferencesPerCycle = 200;
int inference_count = 0;

Adafruit_Arcada arcada;
Adafruit_TFLite ada_tflite(kTensorAreaSize);

// The name of this function is important for Arduino compatibility.
void setup() {
  Serial.begin(115200);
  //while (!Serial) yield();

  arcada.arcadaBegin();
  // If we are using TinyUSB we will have the filesystem show up!
  arcada.filesysBeginMSD();
  arcada.filesysListFiles();
  // Set the display to be on!
  arcada.displayBegin();
  arcada.setBacklight(255);
  arcada.display->fillScreen(ARCADA_BLUE);
  
  if (! ada_tflite.begin()) {
    arcada.haltBox("Failed to initialize TFLite");
    while (1) yield();
  }
  if (arcada.exists("model.tflite")) {
    arcada.infoBox("Loading model.tflite from disk!");
    if (! ada_tflite.loadModel(arcada.open("model.tflite"))) {
      arcada.haltBox("Failed to load model file");
    }
  } else if (! ada_tflite.loadModel(g_sine_model_data)) {
    arcada.haltBox("Failed to load default model");
  }
  Serial.println("\nOK");

  // Keep track of how many inferences we have performed.
  inference_count = 0;
}

// The name of this function is important for Arduino compatibility.
void loop() {
  // Calculate an x value to feed into the model. We compare the current
  // inference_count to the number of inferences per cycle to determine
  // our position within the range of possible x values the model was
  // trained on, and use this to calculate a value.
  float position = static_cast<float>(inference_count) /
                   static_cast<float>(kInferencesPerCycle);
  float x_val = position * kXrange;

  // Place our calculated x value in the model's input tensor
  ada_tflite.input->data.f[0] = x_val;

  // Run inference, and report any error
  TfLiteStatus invoke_status = ada_tflite.interpreter->Invoke();
  if (invoke_status != kTfLiteOk) {
    ada_tflite.error_reporter->Report("Invoke failed on x_val: %f\n",
                           static_cast<double>(x_val));
    return;
  }

  // Read the predicted y value from the model's output tensor
  float y_val = ada_tflite.output->data.f[0];

  // Output the results. A custom HandleOutput function can be implemented
  // for each supported hardware target.
  HandleOutput(ada_tflite.error_reporter, x_val, y_val);

  // Increment the inference_counter, and reset it if we have reached
  // the total number per cycle
  inference_count += 1;
  if (inference_count >= kInferencesPerCycle) inference_count = 0;
}
EN

回答 1

Stack Overflow用户

发布于 2022-11-30 05:52:02

试着从下面的链接安装这个库,它会解决你的问题,

https://github.com/tensorflow/tflite-micro-arduino-examples#how-to-install

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74484309

复制
相关文章
TensorFlow Lite在Kika Keyboard中的应用案例分享
『基于 AI 技术变革沟通,让世界沟通更简单』一直是 Kika keyboard 最重要的使命。从2016年开始,Kika 技术团队一直致力于 AI 技术在移动端落地,尤其是在 keyboard 输入法引擎做了很多算法与工程上的探索工作。2017 年 5 月,Kika 技术团队基于 TensorFlow Mobile 研发了 Kika AI Engine,将其应用于 Kika 的全系输入法产品中。2017 年 11 月,Google 发布 TensorFlow Lite (TF Lite) 后,Kika 技术团队迅速进行了跟进,并于 2018 年 1 月成功地开发了基于 TF Lite 全新一代的 Kika AI Engine,同时进行了线上产品的更新。
智能算法
2018/07/30
1.2K0
TensorFlow Lite在Kika Keyboard中的应用案例分享
使用Tensorflow Lite在Android上构建自定义机器学习模型
机器学习有许多用处,并提供了一个充满未知性的世界。然而,有些人可能会退缩,认为它太难了,其实并不是这样的。使用TensorFlow Lite并不一定都是机器学习专家。下面给大家分享我是如何开始在Android上构建自己的定制机器学习模型的。
AiTechYun
2019/09/16
2.5K0
使用Tensorflow Lite在Android上构建自定义机器学习模型
Arduino 机器学习实战入门(上)
这是来自Arduino团队的Sandeep Mistry和Dominic Pajak的一篇客座文章。
AiTechYun
2019/11/07
3.5K0
TensorFlow Lite for Microcontroller
Microcontrollers (MCUs) are the tiny computers that power our technological environment. There are over 30 billion of them manufactured every year, embedded in everything from household appliances to fitness trackers.
用户6026865
2023/03/03
1K0
TensorFlow Lite for Microcontroller
编译tensorflow-lite-with-select-tf-ops遇到的坑
官方没有直接给出AAR,而是让自己用巴泽尔去编译一个,实在是有点坑啊。
vell001
2018/12/28
5.7K0
编译tensorflow-lite-with-select-tf-ops遇到的坑
用 TensorFlow Lite 在安卓系统上实现即时人体姿态跟踪
作者 | Eileen Mao和Tanjin Prity,谷歌工程实习生,2019年夏季发布。
AiTechYun
2019/08/19
3.8K0
用 TensorFlow Lite 在安卓系统上实现即时人体姿态跟踪
Android上的TensorFlow Lite,了解一下?
TensorFlow Lite是TensorFlow针对移动和嵌入式设备的轻量级解决方案。它可以在移动设备上高效运行机器学习模型,因此您可以利用这些模型进行分类、回归或其他功能,而无需和服务器交互。
云水木石
2019/07/02
1.8K0
Android上的TensorFlow Lite,了解一下?
TensorFlow Lite Micro on CM
Microcontrollers power the world around us.
用户6026865
2023/03/03
1.3K0
TensorFlow Lite Micro on CM
在Mac上,解决由于环境变量错误,导致在终端上无法使用基本命令
此时此刻在当前终端窗口,就可以开心的用linux命令了,千万不要关了当前窗口(救急方案)
新人小试
2020/03/30
2.3K0
GitHub上用于微控制器的TensorFlow Lite
这是TensorFlow Lite的实验端口,针对微控制器和其他只有千字节内存的设备。它不需要任何操作系统支持,任何标准的C或C ++库或动态内存分配,因此它的设计甚至可以移植到“裸机”系统。核心运行时在Cortex M3上适合16KB,并且有足够的运算符来运行语音关键字检测模型,总共占用22KB。
不脱发的程序猿
2021/01/20
5440
qt5的.ui文件在VS2010中无法编译问题
自己手动添加的.ui文件在VS中是无法右键编译的,也即是说,在用QT designer编辑过的.ui文件无法实时更新相应的ui_XX.h文件,造成调试结果无法显示编辑过的新界面。
jianghaibobo
2019/09/11
2.7K0
Manage Jenkins报错:"依赖错误: 部分插件由于缺少依赖无法加载...",解决办法
就是缺少依赖的插件,缺少啥已经列举出来了,我们把对应的插件安装上就好了。 步骤一: 直接点右上角的纠正。
小蓝枣
2020/09/23
2.8K0
TensorFlow Lite for Android 初探(附demo)一. TensorFlow Lite二. tflite 格式三. 常用的 Java API四. TensorFlow Lite
我们知道大多数的 AI 是在云端运算的,但是在移动端使用 AI 具有无网络延迟、响应更加及时、数据隐私等特性。
fengzhizi715
2018/12/07
3.2K0
使用TensorFlow Lite在Android手机上实现图像分类
TensorFlow Lite是一款专门针对移动设备的深度学习框架,移动设备深度学习框架是部署在手机或者树莓派等小型移动设备上的深度学习框架,可以使用训练好的模型在手机等设备上完成推理任务。这一类框架的出现,可以使得一些推理的任务可以在本地执行,不需要再调用服务器的网络接口,大大减少了预测时间。在前几篇文章中已经介绍了百度的paddle-mobile,小米的mace,还有腾讯的ncnn。这在本章中我们将介绍谷歌的TensorFlow Lite。
夜雨飘零
2020/05/06
3.8K0
window编译libevent缺少openssl
下载地址 https://github.com/openssl/openssl 编译
sofu456
2021/02/02
2.1K0
1分钟链圈 | 马化腾:大湾区可挖掘更多的区块链应用场景,比如区块链电子发票
这里是 9 月 6 日的每日1句话新闻晚报,只需1分钟,看看全球最热、最新的区块链新闻。
区块链大本营
2018/09/21
1.1K0
1分钟链圈 | 马化腾:大湾区可挖掘更多的区块链应用场景,比如区块链电子发票
【免费教学】在嵌入式中使用 TensorFlow Lite
第一期中,分享了 TensorFlow Lite 的一些基本知识。今天与大家分享 Android 平台上的一些 TensorFlow Lite 应用,先来一起看看视频吧:
刘盼
2018/07/26
1.6K0
Android Tensorflow 示例代码 Pose Estimation项目编译
原先识别人体骨骼,使用的Google的 MLKit 框架 。方便简单,直接通过Gradle添加相关依赖库。就可以使用了。
zinyan.com
2022/12/07
1.2K0
Android Tensorflow 示例代码 Pose Estimation项目编译
Win10系统编译Tensorflow Lite 2.3为动态链接库tensorflowlite_c.dll
Tensorflow Lite官方在移动端提供了官方编译好的库,我们直接拿来用就好。Tensorflow 在Linux平台与Mac平台下编译也非常轻松,基本不会遇到太多问题(据说Google内部只用Linux与Mac)。但是在Windows下编译真是一波三折,好在已经编译成功了,记录一下Windows 10下Tensorflow Lite编译过程,帮助一下跟我一样被Tensorflow折腾的不行的人。
superhua
2021/01/02
4.8K6
Arduino 机器学习实战入门(下)
按照以下步骤设置Arduino IDE应用程序,该应用程序用于将推理模型上载到您的电路板,并在下一节中从电路板下载培训数据。因为我们需要在Arduino IDE中下载和安装特定的板和库,所以比使用Arduino Create web editor要多几个步骤。
AiTechYun
2019/11/07
3.2K0

相似问题

如何突出蓝鳍金枪鱼的括号?

18

编译tensorflow lite最小示例

12

蓝鳍金枪鱼NRF52最大连接间隔速度(connInterval)

12

由于缺少文件而无法编译

11

红鳍金枪鱼结构的实施

13
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文