Tensorflow对象检测-export_inference_graph.py-分配需要两个张量的形状匹配。 lhs shape = [44] rhs shape = [360]

时间:2018-08-10 14:35:41

标签: python python-3.x tensorflow object-detection

我使用main_model.py训练了11个类(0 =基本+ 10个实际类)的对象检测模型。之后,我要使用export_inference_graph.py导出推理图。我正在使用与训练完全相同的pipeline_config_path,并且trained_checkpoint_prefix参数引用了我训练过的model.ckpt。我收到以下错误:

InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [44] rhs shape= [360]
 [[Node: save/Assign_526 = Assign[T=DT_FLOAT, _class=["loc:@SecondStageBoxPredictor/BoxEncodingPredictor/biases"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](SecondStageBoxPredictor/BoxEncodingPredictor/biases, save/RestoreV2:526)]]

labelmap:https://drive.google.com/file/d/1isVO81rbYRGNrSboUd_DQh03DOxWV5is/view?usp=sharing

配置文件:https://drive.google.com/file/d/1vFkKbU5cytWMJwyt7tztLPxAnQ_bVnNo/view?usp=sharing

Python:3.6.2 Tensorflow:1.3.0

1 个答案:

答案 0 :(得分:0)

您的labelmap和配置不见了。请确保您的num_classes = 11而不是90。