1、开发环境搭建

①、安装Anaconda

  建议选择 Anaconda3-5.0.1 版本,已经集成大多数库,并将其作为默认python版本(3.6.3),配置好环境变量(Anaconda安装则已经配好)。也可以直接安装python,安装各种包比较麻烦,因此直接装了Anaconda集成环境。

  安装完Anaconda后,打开Anaconda Prompt,逐个输入conda --version和python --version,出现下图所示内容则安装成功。

②、安装TensorFlow

  如果是初学者,我们安装cpu版本的tensorflow足够使用。安装TensorFlow-cpu很简单,打开Anaconda Prompt,输入pip install tensorflow。稍等一会就安装成功。通过输入以下代码,检测是否安装成功。

python

import tensorflow as tf

hello = tf.constant('Hello, TensorFlow!')

sess = tf.Session()

print(sess.run(hello))

  如果输出如下图所示,则安装成功。

如果输入import tensorflow as tf出现如下警告:

  FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.from ._conv import register_converters as _register_converters。则需要打开Anaconda Prompt,输入pip install h5py==2.8.0rc1解决。

如果输入 sess = tf.Session()出现Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2,则表明TensorFlow版本太低了,需要打开Anaconda Prompt,输入pip install --upgrade tensorflow解决。

③、下载Tensorflow object detection API模型,从https://github.com/tensorflow/models下载。解压文件到磁盘指定目录,例如C:\Users\CFF\Desktop,重命名为models(此包内包括各种内容,我们所用到的object_detection文件夹在C:\Users\CFF\Desktop\models\research文件夹下)

④、Protobuf 编译。从https://github.com/google/protobuf/releases下载windows版的工具,如protoc-3.6.1-win32.zip,解压到C:\Users\CFF\Desktop,生成:bin, include两个文件夹。打开Anaconda Prompt,cd C:\Users\CFF\Desktop\models\research ,输入C:\Users\CFF\Desktop\bin\protoc ,编译结果如下说明可以开始编译。

Protobuf 编译,用protoc可执行文件编译目录object_detection/protos下的proto文件,生成Python文件。如:C:\Users\CFF\Desktop\bin\protoc object_detection/protos/*.proto --python_out=.。如何出现object_detection/protos/*.proto目录没有发现,可以将*号改成对应的文件逐个编译,生成对应的Python文件。

⑤、测试。打开Anaconda Prompt,cd C:\Users\CFF\Desktop\models\research目录,输入jupyter notebook,跳转到网页界面。

在cell中选择runAll,正常的话稍等一会儿就会有结果:

到此,已经成功完成了环境搭建与测试。

⑥、用来测试自己的图片,改变PATH_TO_TEST_IMAGES_DIR 的路径,我的如下所示。测试图片命名为image1.jpg   image2.jpg... 相应的数量for i in range(1, 3)也要根据自己的图片数量进行改变。

运行后,输出结果如下:

Tensorflow object detection API ——环境搭建与测试的更多相关文章

  1. 使用Tensorflow object detection API——环境搭建与测试

    [软件环境搭建] 操作系统:windows 10 64位 内存:8G CPU:I7-6700 Tensorflow: 1.4 Python:3.5 Anaconda3 (64-bit) 以上环境搭建请 ...

  2. TensorFlow Object Detection API(Windows下测试)

    "Speed/accuracy trade-offs for modern convolutional object detectors." Huang J, Rathod V, ...

  3. Tensorflow object detection API(1)---环境搭建与测试

    参考: https://blog.csdn.net/dy_guox/article/details/79081499 https://blog.csdn.net/u010103202/article/ ...

  4. Tensorflow object detection API 搭建物体识别模型(二)

    二.数据准备 1)下载图片 图片来源于ImageNet中的鲤鱼分类,下载地址:https://pan.baidu.com/s/1Ry0ywIXVInGxeHi3uu608g 提取码: wib3 在桌面 ...

  5. Tensorflow object detection API 搭建属于自己的物体识别模型

    一.下载Tensorflow object detection API工程源码 网址:https://github.com/tensorflow/models,可通过Git下载,打开Git Bash, ...

  6. Tensorflow object detection API 搭建物体识别模型(四)

    四.模型测试 1)下载文件 在已经阅读并且实践过前3篇文章的情况下,读者会有一些文件夹.因为每个读者的实际操作不同,则文件夹中的内容不同.为了保持本篇文章的独立性,制作了可以独立运行的文件夹目标检测. ...

  7. Tensorflow object detection API 搭建物体识别模型(三)

    三.模型训练 1)错误一: 在桌面的目标检测文件夹中打开cmd,即在路径中输入cmd后按Enter键运行.在cmd中运行命令: python /your_path/models-master/rese ...

  8. Tensorflow object detection API 搭建物体识别模型(一)

    一.开发环境 1)python3.5 2)tensorflow1.12.0 3)Tensorflow object detection API :https://github.com/tensorfl ...

  9. 谷歌开源的TensorFlow Object Detection API视频物体识别系统实现(一)[超详细教程] ubuntu16.04版本

    谷歌宣布开源其内部使用的 TensorFlow Object Detection API 物体识别系统.本教程针对ubuntu16.04系统,快速搭建环境以及实现视频物体识别系统功能. 本节首先介绍安 ...

随机推荐

  1. angularjs ng-if 中的ng-model 值作用域问题

    现象:最近做了一个需求,页面上使用了ng-if 条件做判断,导致通过使用 $scope 获取不到 ng-model 的值. 问题原因: ng-if这个指令单独开了一个作用域,它只可以继承,不可以进行往 ...

  2. centos7安装nginx-1.13.6 新手入门,图文解析

    系统环境 操作系统:64位CentOS Linux release 7.2.1511 (Core) 安装nginx依赖包 [root@localhost ~]# yum install gcc-c++ ...

  3. poj2976 Dropping tests(01分数规划 好题)

    https://vjudge.net/problem/POJ-2976 又是一波c++AC,g++WA的题.. 先推导公式:由题意得 Σa[i]/Σb[i]<=x,二分求最大x.化简为Σ(a[i ...

  4. python全栈开发 * 继承性 层叠性 盒模型 标准文档流 * 180809

    ---恢复内容开始--- 一继承性 1.继承: 给父级设置一些属性,子级继承了父级的该属性,这就是我们的css中的继承. 2. 可继承: color . font-*(size). text-*(de ...

  5. 腾讯云“智能+互联网TechDay”:揭秘智慧出行核心技术与创新实践

    现如今,地面交通出行与大家的生活息息相关.在当前城市道路日益复杂和拥挤的情况下,如何保证交通出行的安全和便捷相信是每个人以及众多专家.科研工作者重点关注的问题. “智慧交通”系统是解决交通发展瓶颈的有 ...

  6. [02-01]Java学习路线(完整详细版)

    Java基础课程 Java基础课程内容涉及:Java开发介绍.Java数组.Java面向对象.常用基础类.集合.IO流.多线程.异常.网络.反射. 第一阶段:Java基础 1 第一部分:Java开发介 ...

  7. grumphp在docker里问题

    .git/hooks/commit-msg .git/hooks/pre-commit 这两个文件的路径指向为docker环境下,如果在容器外执行提交会发现找不到路径,所以要修改这两个文件的路径为容器 ...

  8. vueX、vue中transition的使用、axios

    引入一篇好文章链接:看一遍就会的vuex文章;完!!! vue中transtion的使用:transition文章;完!!! axios的文章:axios;完!!!

  9. css实现三角形相关

    1.css样式面包屑导航条实现矩形和三角箭头拼接 .cssTest { font-family: PingFangSC-Regular; font-size: 16px; color: #333333 ...

  10. 5.6版本GTID复制异常处理一例(转)

    http://imysql.com/2014/07/31/mysql-faq-exception-replication-with-gtid.shtml 昨天处理了一个MySQL 5.6版本下开启GT ...