1.环境ubuntu14.04.5

安装TensorFlow

官方文档:https://www.tensorflow.org/install/install_linux

sudo pip  install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.1-cp27-none-linux_x86_64.whl  

注意:后面的网址根据不同设置而不同:

 Python 2.7  

 CPU only:  

 https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.1-cp27-none-linux_x86_64.whl
GPU support: https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.0.1-cp27-none-linux_x86_64.whl
Note that GPU support requires the NVIDIA hardware and software described in NVIDIA requirements to run TensorFlow with GPU support. Python 3.4 CPU only: https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.1-cp34-cp34m-linux_x86_64.whl
GPU support: https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.0.1-cp34-cp34m-linux_x86_64.whl
Note that GPU support requires the NVIDIA hardware and software described in NVIDIA requirements to run TensorFlow with GPU support. Python 3.5 CPU only: https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.1-cp35-cp35m-linux_x86_64.whl
GPU support: https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.0.1-cp35-cp35m-linux_x86_64.whl
Note that GPU support requires the NVIDIA hardware and software described in NVIDIA requirements to run TensorFlow with GPU support. Python 3.6 CPU only: https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.1-cp36-cp36m-linux_x86_64.whl
GPU support: https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.0.1-cp36-cp36m-linux_x86_64.whl

我选择了相当于:python2.7 纯CPU

自动安装无误,若有安装失败,可能是网络问题,重新执行一遍试试。

也有可能是若干依赖没有装好:先把 各种依赖都安一遍

下载神经网络模型:http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz

 mkdir model
tar -xf archive_name.tar -C model/

下载代码:https://codeload.github.com/tensorflow/models/zip/master

 unzip models-master.zip
cd models-master/tutorials/image/imagenet/

其中的classify_image.py是我们实现物体识别的主代码

接下来做几个测试

 classify_image.py --model_dir /home/usr/model --image_file /home/usr/model/cropped_panda.jpg
classify_image.py --model_dir /home/usr/model --image_file /home/usr/model/testkb.jpg
classify_image.py --model_dir /home/usr/model --image_file /home/usr/model/testmous.jpg

 giant panda, panda, panda bear, coon bear, ailuropoda melanoleuca (score = 0.89107)
computer keyboard, keypad (score = 0.64016)
mouse, computer mouse(score = 0.89453)

最新文章

  1. DOMO1
  2. scrollview 图片放大 捏合 瓦片地图 相关注意事项
  3. oc程序代码
  4. Linux搭建FTP
  5. String,StringBuffer,StringBuilder的区别及其源码分析
  6. RabbitMQ基础入门
  7. Chipmunk僵尸物理对象的出现和解决(七)
  8. Ajax的初步认识
  9. [matlab] 1.拟合
  10. 2017-12-22 日语编程语言"抚子"-第三版实现初探
  11. C#编程(七十九)---------- 反射
  12. php 把秒数转换为时长(h:i:s格式)
  13. ios实例开发精品文章推荐(8.13)
  14. C# 两个时间相减 返回 对应天时分秒
  15. 7 -- Spring的基本用法 -- 6... Spring 3.0 提供的Java配置管理
  16. 在mvc4中上传、导入和导出excel表方法总结
  17. Opencv读取图片像素值
  18. [算法] 将单链表的每K个节点之间逆序
  19. Django进阶Template篇002 - 模板包含和继承
  20. 14-jQuery的ajax

热门文章

  1. MVP框架模式
  2. ThinkPHP 3.2 调用自定义函数库
  3. ssh 上传文件以及文件夹到linux服务器
  4. redis集群登陆
  5. JSP乱码(小记)
  6. Eclipse 中 ctrl+鼠标左键 快捷查看资源失效
  7. windows 实用小工具(截图、进程管理)
  8. 常用SQL语句积累
  9. Spring bean作用域
  10. php non-thread-safe和thread-safe这两个版本有何区别?