Using tensorflow hub with go

陌路散爱 提交于 2019-12-20 07:19:10

问题


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/).

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

How can I download and use these models in go?


回答1:


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

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.

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.

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.



来源:https://stackoverflow.com/questions/56651461/using-tensorflow-hub-with-go

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!