Tensorflow object detection API ——环境搭建与测试
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 ——环境搭建与测试的更多相关文章
- 使用Tensorflow object detection API——环境搭建与测试
[软件环境搭建] 操作系统:windows 10 64位 内存:8G CPU:I7-6700 Tensorflow: 1.4 Python:3.5 Anaconda3 (64-bit) 以上环境搭建请 ...
- TensorFlow Object Detection API(Windows下测试)
"Speed/accuracy trade-offs for modern convolutional object detectors." Huang J, Rathod V, ...
- Tensorflow object detection API(1)---环境搭建与测试
参考: https://blog.csdn.net/dy_guox/article/details/79081499 https://blog.csdn.net/u010103202/article/ ...
- Tensorflow object detection API 搭建物体识别模型(二)
二.数据准备 1)下载图片 图片来源于ImageNet中的鲤鱼分类,下载地址:https://pan.baidu.com/s/1Ry0ywIXVInGxeHi3uu608g 提取码: wib3 在桌面 ...
- Tensorflow object detection API 搭建属于自己的物体识别模型
一.下载Tensorflow object detection API工程源码 网址:https://github.com/tensorflow/models,可通过Git下载,打开Git Bash, ...
- Tensorflow object detection API 搭建物体识别模型(四)
四.模型测试 1)下载文件 在已经阅读并且实践过前3篇文章的情况下,读者会有一些文件夹.因为每个读者的实际操作不同,则文件夹中的内容不同.为了保持本篇文章的独立性,制作了可以独立运行的文件夹目标检测. ...
- Tensorflow object detection API 搭建物体识别模型(三)
三.模型训练 1)错误一: 在桌面的目标检测文件夹中打开cmd,即在路径中输入cmd后按Enter键运行.在cmd中运行命令: python /your_path/models-master/rese ...
- Tensorflow object detection API 搭建物体识别模型(一)
一.开发环境 1)python3.5 2)tensorflow1.12.0 3)Tensorflow object detection API :https://github.com/tensorfl ...
- 谷歌开源的TensorFlow Object Detection API视频物体识别系统实现(一)[超详细教程] ubuntu16.04版本
谷歌宣布开源其内部使用的 TensorFlow Object Detection API 物体识别系统.本教程针对ubuntu16.04系统,快速搭建环境以及实现视频物体识别系统功能. 本节首先介绍安 ...
随机推荐
- 编写程序,将来自文件中的行保存在一个vector<string>,然后使用一个istringstream 从vector中读取数据,每次读一个单词
#include<fstream> #include <vector> #include<string> #include<iostream> #inc ...
- oldboy es和logstash
logstash: input:https://www.elastic.co/guide/en/logstash/current/input-plugins.html input { file { p ...
- 21 ArcMap 10.6.1 添加Excel格式数据
注:此次的操作软件为ArcMap10.6.1,在ArcMap其它版本中也可使用,如遇到问题,欢迎交流. 1:Excel中数据(点)标准化(一般是经纬度),将原来的度分秒表示的都要转换成度表示的,如图所 ...
- java实现文章敏感词过滤检测
SensitivewordFilter.java import java.util.HashSet; import java.util.Iterator; import java.util.Map; ...
- SPFA找最大比例环
SPFA找最大比例环 ans=Σ点权/Σ边权 所以 可以变式为 Σ边权*ans-Σ点权=0 要找出最大的ans 可以二分 边权值变为 目的地点权-ans*边权 检查是否有负环 有则可以更优 #incl ...
- 2018-2019-2 20175320实验二《Java面向对象程序设计》实验报告
2018-2019-2 20175320实验二<Java面向对象程序设计>实验报告 一.实验步骤及内容 (一)了解使用JUint,并对示例代码MyUtil进行测试 1.先在IDEA中安装J ...
- 出现errSecInternalComponent
出现errSecInternalComponent Xcode签名机制(code signing mechanism) 的 bug, Xcode 中账号多了,就会产生很多过期的描述文件,Xcode 没 ...
- centos7安装mysql8
1.检查系统是否有安装mysql或mariadb,如果有则删除 2.yum localinstall https://repo.mysql.com//mysql80-community-release ...
- arcengine导出复本
参考: https://gis.stackexchange.com/questions/172315/creating-checkout-replica-in-arcobjects-from-arcs ...
- oracle_dataGuard_11G
[李红]--切记_从库只安装实例_不需要 dbca 创建数据库 但是 netca 创建监听看个人喜欢,我反正是创建了.[DataGuard_主数据库的参数配置]1.启用 force logging 功 ...