美文网首页我爱编程
tensorflow学习(mac)

tensorflow学习(mac)

作者: 人生墨鱼 | 来源:发表于2016-12-20 14:01 被阅读0次

http://www.tuicool.com/articles/Fni2Yr

远程连接linux

ssh user@hostname

注:上边代码为固定格式,其中

user 为 linux 服务器的管理员名称

hostname 为 linux 服务器的IP

如: ssh haibor@1.2.3.4

远程copy文件到linux

scp /Users/friendlove-pc/Downloads/tensorflow-0.12.1-cp27-none-linux_x86_64.whl root@114.55.251.118:/data/tensorflow/

linux系统需要源码安装

$ git clone https://github.com/tensorflow/tensorflow

下载bazel-0.4.3-installer-linux-x86_64.sh

权限

chmod +x bazel-0.4.3-installer-linux-x86_64.sh

安装

./bazel-0.4.3-installer-linux-x86_64.sh

$ sudo apt-get install python-numpy python-dev python-wheel python-mock

./configure

$ bazel build -c opt //tensorflow/tools/pip_package:build_pip_package

bazel build --copt=-march=ivybridge -c opt //tensorflow/tools/pip_package:build_pip_package

编译卡住就考虑内存问题,解决办法:添加虚拟内存(swap)

机器学习

$ cd ~/tensorflow

$ source bin/activate

$ sudo python /Users/friendlove-pc/Documents/tensorflow-master/tensorflow/examples/image_retraining/retrain.py --image_dir /Users/friendlove-pc/Downloads/sea_img

$ python /Users/friendlove-pc/Documents/imageclassify.py /Users/friendlove-pc/Downloads/1.jpg

Process pr = Runtime.getRuntime().exec("python " + pyFile + " "+ analyzeFile);

相关文章

网友评论

    本文标题:tensorflow学习(mac)

    本文链接:https://www.haomeiwen.com/subject/dbqgmttx.html