请问我在运行第五章的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)
第三章,采用rennet_v1_50模型进行训练,已经训练完成,想导出模型对单张图像进行识别,最后的classfy_image_inception_v3.py出现错误,应该怎么修改呀? KeyError: “The name ‘resnet_v1/logits/SpatialSqueeze:0’ refers to a Tensor which does not exist. The operation, ‘resnet_v1/logits/SpatialSqueeze’, does not exist in the graph.”
讲的不清晰,用法没有说明原因,没有文献引用,看的有头无尾
python train_image_classifier.py —train_dir=satellite/train_dir —dataset_name=satellite —dataset_split_name=train —dataset_dir=satellite/data model_name=inception_v3 —checkpoint_path=satellite/pretrained/inception_v3.ckpt —checkpoint_exclude_scopes=InceptionV3/Logits,InceptionV3/AuxLogits —trainable_scopes=InceptionV3/Logits,InceptionV3/AuxLogits —max_number_of_steps=100000 —batch_size=32 —learning_rate=0.001 —learning_rate_decay_type=fixed —s**e_interval_secs=300 —s**e_summaries_secs=2 —log_every_n_steps=10 —optimizer=rmsprop —weight_decay=0.00004
哪里有问题呢?这是第三章的,按书本来的
请问我在运行第五章的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
一直没找到解决办法,是图片的问题还是编码格式的问题?望帮我解答。
第三章,采用rennet_v1_50模型进行训练,已经训练完成,想导出模型对单张图像进行识别,最后的classfy_image_inception_v3.py出现错误,应该怎么修改呀?
KeyError: “The name ‘resnet_v1/logits/SpatialSqueeze:0’ refers to a Tensor which does not exist. The operation, ‘resnet_v1/logits/SpatialSqueeze’, does not exist in the graph.”