更新训练有素的对象检测模型以对应TF更新

时间:2019-03-26 13:57:20

标签: python tensorflow object-detection-api

出于稳定性原因,我正在过渡到新版本的TF(从主线切换到CUDA 10之前,我在Ubuntu 18.04上使用每晚的docker构建)。当我尝试在新版本中运行模型时,出现以下错误,我认为这意味着与在旧版本上训练的模型不兼容。
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/importer.py", line 426, in import_graph_def graph._c_graph, serialized, options) # pylint: disable=protected-access tensorflow.python.framework.errors_impl.InvalidArgumentError: NodeDef mentions attr 'explicit_paddings' not in Op<name=Conv2D; signature=input:T, filter:T -> output:T; attr=T:type,allowed=[DT_HALF, DT_BFLOAT16, DT_FLOAT, DT_DOUBLE]; attr=strides:list(int); attr=use_cudnn_on_gpu:bool,default=true; attr=padding:string,allowed=["SAME", "VALID"]; attr=data_format:string,default="NHWC",allowed=["NHWC", "NCHW"]; attr=dilations:list(int),default=[1, 1, 1, 1]>; NodeDef: {{node FirstStageFeatureExtractor/resnet_v1_101/resnet_v1_101/conv1/Conv2D}}. (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).

我需要做些什么来更新先前训练过的模型以使其与新版本的TF配合使用,或者我需要继续运行该版本直到下一次训练课程?

1 个答案:

答案 0 :(得分:0)

进行一些查看后,必须更新图形。由于我仍然没有训练检查点,因此我成功地通过从先前冻结的图导出为检查点来更新图。 python3 export_inference_graph.py --input_type image_tensor --pipeline_config_path FROZENGRAPHDIRECTORY/pipeline.config --trained_checkpoint_prefix FROZENGRAPHDIRECTORY/model.ckpt --output_directory FROZENGRAPHDIRECTORY_tfNEWTFVERSION

相关问题