go版tensorflow安装
此文章基于ubuntu16.04
先在这里贴上官方教程
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/go
注意 安装go版的tensorflow时一定要先安装C版tensorflow且要部署好go语言
c版tensorflow官方教程
(Go 版本 TensorFlow 依赖于 TensorFlow C 语言库)
按照官方的指导就可以,没什么坑,最好是官方指定位置,否则后面可能会有坑!
安好后执行这个命令
go get -d github.com/tensorflow/tensorflow/tensorflow/go
可能会出现go get 找不到 google.golang.org/protobuf/×××××××××× 这类问题
此时我们可以使用git clone命令,执行如下代码“https://github.com/protocolbuffers/protobuf-go.git”,将下载内容放入protobuf文件夹中,即把下载下来中的内容全部替换到出问题的protobuf目录,这可能是之前代码换地址导致的问题
执行如下命令(下载下来后记得把文件替换,或者直接改名字把protobuf-go改成protobuf换目录)
git clone https://github.com/protocolbuffers/protobuf-go.git
如果找不到相应的目录可以用如下命令获取 (https有可能获取不到,这时将https改成git,用镜像源即可)
git clone https://github.com/grpc/grpc-go.git $GOPATH/src/google.golang.org/grpc
git clone https://github.com/golang/net.git $