可以在 QT 项目中使用 Tensorflow C++ API 吗? [英] It is possible to use Tensorflow C++ API in QT project?

查看:69
本文介绍了可以在 QT 项目中使用 Tensorflow C++ API 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Python API 训练了一个用于图像分类的 Tensorflow 模型,然后我保存了模型检查点.

I trained a Tensorflow model for image classification using the Python API, then i saved the model checkpoint.

现在我想在 QT(C++) 项目中加载这个模型.

Now I want to load this model in a QT(C++) project.

在查看文档后,我发现要使用 Tensorflow C++ API,您需要在 TensorFlow github 存储库的克隆中创建一个项目,然后使用 Bazel 构建它,这在我的情况下是不可能的.

After looking into documentations, I found that to use Tensorflow C++ API you need to create a project inside a clone of the TensorFlow github repository, then build it with Bazel, who is not possible in my case.

有没有办法在我的 QT 项目中包含 tensorflow 库?

Is there a way to include tensorflow library in my QT project ?

推荐答案

您需要 bazel(或 CMake)来构建 tensorflow 库,但是一旦编译完成,您就可以自由使用任何您喜欢的工具并将其视为外部图书馆.

You need bazel (or CMake) to build the tensorflow library, but once it is compiled you are free to use whatever tool you like and treat it like an external library.

相信我,一旦你编译了 tensorflow,你最不想做的就是将它添加到你的项目中并意外地重建它.这个婴儿需要时间.

Believe me, once you have compiled tensorflow, the last thing you want to do is add it to your project and rebuild it accidentally. This baby takes time.

这篇关于可以在 QT 项目中使用 Tensorflow C++ API 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆