在Go中使用Tensorflow Hub [英] Using tensorflow hub with go

查看:188
本文介绍了在Go中使用Tensorflow Hub的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的go应用程序中使用经过预先训练的模型.特别是Inception-ResNet-v2模型. 该模型似乎只能通过tensorflow集线器( https://www.tensorflow.org/hub/).

I want to use pre trained models in my go application. Especially the Inception-ResNet-v2 model. This model seems to be only available via tensorflow hub (https://www.tensorflow.org/hub/).

但是我找不到任何有关如何使用带有Tenorflow的go语言绑定的tensorflow hub的文档.

However I could not find any documentation how to use tensorflow hub with the go language bindings for tensorflow.

如何在go中下载和使用这些模型?

How can I download and use these models in go?

推荐答案

因此,在过去几天的大量工作之后,我终于找到了一种方法.

So after a lot of work in the past few days I finally found a way.

起初,我只想使用Python来完成所有Tensorflow的工作,然后通过rest服务提供结果.但是事实证明,Tensorflow Hub提供的模型数量很少.这对我来说是个问题,因为我必须尝试不同的模型并进行比较.

At first I wanted to just use Python to do all the Tensorflow stuff and then provide the results via a rest service. However it turned out that the number of models provided by Tensorflow Hub is very small. This was a problem for me because I had to try out different models and compare them.

因此,我转而使用 https://github.com/tensorflow/models 中的模型.有一些教程如何将数据导出到.pb文件.然后可以使用gocv将这些文件加载​​到Go中.

Thus I switched to using models from https://github.com/tensorflow/models. There are several tutorials how to export the data to .pb files. Those files can then be loaded in Go using gocv.

转换文件需要大量工作,但最终我认为这是在使用Tensorflow模型的最佳方法.

It requires a lot of work to convert the files, but in the end I think this is the best way to use Tensorflow models in go.

这篇关于在Go中使用Tensorflow Hub的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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