最近在使用Object Detection中,出现assign requires shapes of both tensors to match
解决方法:
config中设置的model为官网上预训练的ckpt位置,
fine_tune_checkpoint: \ #这个是预训练好的模型位置
"/object_detect/models/research/object_detection/ssd_inception_v2_coco_2018_01_28/model.ckpt"
from_detection_checkpoint: true
把执行时存储的model_path 改为其他的路径
# From the tensorflow/models/research/ directory
PIPELINE_CONFIG_PATH={path to pipeline config file} #config的路径
MODEL_DIR={path to model directory} #这个一定是新的路径存放新训练的ckpt文件,不能和上面config中的model位置一样
#例如:‘/object_detect/models/research/object_detection/train_model’
NUM_TRAIN_STEPS=50000
SAMPLE_1_OF_N_EVAL_EXAMPLES=1
python object_detection/model_main.py \
--pipeline_config_path=${PIPELINE_CONFIG_PATH} \
--model_dir=${MODEL_DIR} \
--num_train_steps=${NUM_TRAIN_STEPS} \
--sample_1_of_n_eval_examples=$SAMPLE_1_OF_N_EVAL_EXAMPLES \
--alsologtostderr