请问我在运行第五章的train.py文件时出现如下错误该怎么解决,谢谢!!!TypeError: Cannot convert a list containing a tensor of dtype <dtype: 'int32'> to <dtype: 'float32'> (Tensor is: <tf.Tensor 'Preprocessor/stack_1:0' shape=(1, 3) dtype=int32>)
@yhlz49 解决了,tfrecord.py改两处
1:
def _bytes_feature(value):
"""Wrapper for inserting bytes features into Example proto."""
value = tf.compat.as_bytes(value)
return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value]))
2:
# Read the image file.
image_data=tf.gfile.FastGFile(filename,'rb').read()
# Convert any PNG to JPEG's for consistency.
if _is_png(filename):
logging.info('Converting PNG to JPEG for %s' % filename)
image_data = coder.png_to_jpeg(image_data)
很多数据集根本没提供啊
讲的不清晰,用法没有说明原因,没有文献引用,看的有头无尾
哪里有问题呢?这是第三章的,按书本来的
请问我在运行第五章的train.py文件时出现如下错误该怎么解决,谢谢!!!TypeError: Cannot convert a list containing a tensor of dtype <dtype: 'int32'> to <dtype: 'float32'> (Tensor is: <tf.Tensor 'Preprocessor/stack_1:0' shape=(1, 3) dtype=int32>)
第三课中的一段代码报错了,tfrecord.py中的
Read the image file.
报错为:
UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xff in position 0: illegal multibyte sequence
一直没找到解决办法,是图片的问题还是编码格式的问题?望帮我解答。