Tensorflow 填坑日记
来源:互联网 发布:龙江网络 客服电话多少 编辑:程序博客网 时间:2024/06/05 04:47
坑一、UnicodeEncodeError: 'utf-8' codec can't encode character '\udcce' in position 1936: surrogates not a
这个坑搞了我很久,开始以为是python的版本问题 然后一路pint命令下去 发现是label_map_util.py这边的
with tf.gfile.FastGFile(path, 'r') as fid:
label_map_string = fid.read()
出了问题 我单独抽出来
于是自己写了一段
import matplotlib.pyplot as plt; import tensorflow as tf; image_raw_data_jpg = tf.gfile.FastGFile('D:\我的图片s\1.jpg', 'rb').read() with tf.Session() as sess: img_data_jpg = tf.image.decode_jpeg(image_raw_data_jpg) #解码 img_data_jpg = tf.image.convert_image_dtype(img_data_jpg, dtype=tf.uint8) encode_image_jpg = tf.image.encode_jpeg(img_data_jpg) #jpg编码 encode_image_png = tf.image.encode_png(img_data_jpg)#png编码 with tf.gfile.GFile('output.jpg', 'wb') as f: f.write(encode_image_jpg.eval()) with tf.gfile.GFile('output.png', 'wb') as f: f.write(encode_image_png.eval())发现还是
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcd5' in position 1942: surrogates not allowed
于是 我发现路径我打多了一个s
D:\我的图片s\1.jpg
于是我猜测是路径不对引起的读取错误
于是我
直接写
# In[ ]:label_map = label_map_util.load_labelmap("D:\\models-master\\research\\object_detection\\data\\mscoco_label_map.pbtxt")categories = label_map_util.convert_label_map_to_categories(label_map, max_num_classes=NUM_CLASSES, use_display_name=True)category_index = label_map_util.create_category_index(categories)好了 运行通过
问题:路径不对造成的读取错误
-------------------------------------------------未完待续----------------------------------------------------------------------------------------
阅读全文
0 0
- Tensorflow 填坑日记
- springboot填坑日记
- tensorflow编程填坑笔记
- 填坑日记2017.3.6
- win10安装TensorFlow填坑笔记
- 填坑Tensorflow Object Dection API
- win10安装TensorFlow填坑笔记
- Ionic 填坑日记(一)
- Ionic填坑日记(二)
- 前端国际化解决方案“填坑日记”
- Tensorflow编译Android版本步骤及填坑(CentOS && Mac)
- WindowsPhone&Windows8.1&Windows8&Unity3d 填坑日记
- Unity Windows 填坑日记之导出篇
- Windows 填坑日记之Windows 8 虚拟键盘问题
- UE4填坑日记之-生成.sln文件的问题
- 【UNITY填坑日记】unity图片资源优化神器dither4444
- 一、VueJs 填坑日记之基础概念知识解释
- WIN10+VS2017+TensorFlow-gpu 被坑日记
- maven+spring MVC +jpa框架里面的单元测试出现spring-test的版本与其他的spring的版本不一样出现的问题
- redis-cluster核心原理分析:gossip通信、jedis smart定位、主备切换
- 流程控制语句
- 网页布局、样式精简总结记录(一)
- linux下对sh文件的基本操作总结
- Tensorflow 填坑日记
- oracle 游标
- highcharts中设置被x轴和y轴围在里面的背景色
- java基础面试题
- Adobe After Effects CC 2018 Mac (ae mac中文破解版)含激活工具与破解方法 15.0.0中文破解版
- 用VS2008的MFC写的CAD画图程序2017.12.15
- js导出excel的实现
- hbase集群在启动的时候报错:JAVA_HOME is not set and Java could not be found
- yii2框架发送邮件