解决方案:
deeplab/input_preprocess.py中
找到
if is_training and label is not None
然后添加:
else:
rr = tf.minimum(tf.cast(crop_height,tf.float32)/tf.cast(image_height,tf.float32),
tf.cast(crop_width,tf.float32)/tf.cast(image_width,tf.float32))
newh = tf.cast(tf.cast(image_height, tf.float32)*rr, tf.float32)
neww = tf.cast((tf.cast(image_width, tf.float32)*rr), tf.float32)
processed_image = tf.image.resize_images(
processed_image, (newh, neww), method=tf.image.ResizeMethod.BILINEAR, align_corners=True)
processed_image = preprocess_utils.pad_to_bounding_box(
processed_image, 0, 0, crop_height, crop_width, mean_pixel)
在执行命令的时候额外添加
--min_resize_value 513 --max_resize_value 513
整个命令如下
python deeplab/eval.py --logtostderr --eval_split="val" --model_variant="xception_65" --atrous_rates=6 --atrous_rates=12 --atrous_rates=18 --output_stride=16 --decoder_output_stride=4 --eval_crop_size="513,513" --dataset="seasons_vision" --checkpoint_dir="/mnt/deeplabv3plus-label7/research/deeplab/datasets/seasons_seg_output/train_model" --eval_logdir="/mnt/deeplabv3plus-label7/research/deeplab/datasets/seasons_seg_output/eval" --dataset_dir="/mnt/deeplabv3plus-label7/research/deeplab/datasets/seasons_seg/tfrecords" --min_resize_value 513 --max_resize_value 513
参考链接:
https://github.com/tensorflow/models/issues/3695



