tensorflow项目中使用tfrecods格式数据集文件等问题小结

人工智能77

最开始参考的两篇博客:

VOC文件 TFRecord文件 生成\转换

SSD目标检测实战(TF项目)——VOC2007(注:这个项目中是有对应的转换程序,但该程序有contrib模块,这个只能在tf1.版本中有)

添加问题1:

问题描述:

ImportError: cannot import name 'trt_convert' from 'tensorflow.python.compiler.tensorrt'

No module named compiler.tensorrt

讨论:
https://github.com/tensorflow/tensorrt/issues/84

https://github.com/gsethi2409/tf-pose-estimation/issues/7

tensorflow项目中使用tfrecods格式数据集文件等问题小结
这个错误是因为该模块代码在win端不支持,需要在linux下运行实验

; 添加问题2:

问题描述:

'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

解决方案
将'r'改为'rb'的形式,即:

image_raw_data_jpg = tf.gfile.FastGFile('.../test_images/test_1.jpg', 'rb').read()

参考:https://blog.csdn.net/u013555719/article/details/77991010

Original: https://blog.csdn.net/weixin_42245375/article/details/121260921
Author: lingle1
Title: tensorflow项目中使用tfrecods格式数据集文件等问题小结