Golang版Tensorflow安装记录

废话不多说直接上代码

mkdir ~/.pip
echo "[global]
      index-url = https://pypi.douban.com/simple" > ~/.pip/pip.conf
sudo pip install --upgrade pip
sudo pip install --upgrade scipy numpy scikit-learn
go get -d github.com/tensorflow/tensorflow/tensorflow/go
sudo add-apt-repository ppa:webupd8team/java
echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
curl https://storage.googleapis.com/bazel-apt/doc/apt-key.pub.gpg | sudo apt-key add -
sudo apt-get update && sudo apt-get install oracle-java8-installer bazel
cd ${GOPATH}/src/github.com/tensorflow/tensorflow
./configure
bazel build --config opt //tensorflow:libtensorflow.so
sudo cp ${GOPATH}/src/github.com/tensorflow/tensorflow/bazel-bin/tensorflow/libtensorflow.so /usr/local/lib
sudo ldconfig
go test github.com/tensorflow/tensorflow/tensorflow/go

当然具体问题还是要具体分析,有问题可以给我留言。

你可能感兴趣的:(Go,Learning)