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系统,快速搭建环境以及实现视频物体识别系统功能. 本节首先介绍安 ...
随机推荐
- linux命令技巧
printf "%-5s %-10s %-4s\n" No Name Mark printf "%-5s %-10s %-4.2f\n" 1 Sarath 80 ...
- IPV6配置
云友“学渣王 ”在帖子里提到需要为阿里云ECS配置IP6地址,根据网上的一些信息,写此例. 如果要求是FQDN地址,请登录到您的域名控制面板,设置一条AAAA记录到新设置的IPv6隧道地址. 在阿 ...
- js的作用域题
---恢复内容开始--- 1. var a = 12 function fn() { console.log(a) var a = 45; console.log(a) } fn() 2. funct ...
- jquery $.ajax({});参数详解
用到过的: type:请求方式,默认 GET: url:请求路径: data:请求参数,类型是String:JSON.stringify({"name":tom,"age ...
- 华大单片机开发板HC32F030上手入门
HC32F030开发板(如下图所示)分为板载调试模块(左半部分)和MCU开发电路(右半部分).二者中间通过邮票孔相连,如果将板子从中间掰开,板载调试模块就可以当一个CMSIS-DAP的仿真器来使用.此 ...
- 屏蔽登录QQ后总是弹出的QQ网吧页面
不知道从什么时候开始的,每次登录QQ的时候,有个叫qq网吧的页面都会弹出来,腾讯你是撒吗?这个公司真是死性不改.按照它的提示,已经设置了好几次这是我家,这特么不是网吧,然并卵.你说它技术不行吧,它堪称 ...
- -webkit-box-orient: vertical; 在webpack上失效
-webkit-box-orient: vertical;在webpack上失效,可以使用以下方式解决 .ifc-header-content-comment { text-overflow: ell ...
- Cookie/Session的机制与安全
转载自:https://harttle.land/2015/08/10/cookie-session.html Cookie和Session是为了在无状态的HTTP协议之上维护会话状态,使得服务器可以 ...
- 【tomcat启动失败问题】Unable to start embedded Tomcat
启动spring boot 项目后抛出如下异常: org.springframework.context.ApplicationContextException: Unable to start em ...
- openssh-win64 on windows2016 ssh pub key config
DO NOT follow the official M$ documentation at https://docs.microsoft.com/en-us/windows-server/admin ...