tensorflow object detection 从现有检查点微调模型

我正在尝试按照这些说明从现有检查点训练模型。

我已经使用faster_rcnn_resnet101_voc07.config配置文件配置了对象检测训练管道。

在检查点部分,我设置了预训练模型检查点文件所在的目录faster_rcnn_resnet101_coco.tar.gz

根据这个问题fine_tune_checkpoint可以是包含三个文件的目录路径:(.data-00000-of-00001, .index, .meta)。

所以我设置了目录路径为”/home/docs/car_dataset/models/model/train

gradient_clipping_by_norm: 10.0  fine_tune_checkpoint: "/home/docs/car_dataset/models/model/train"  from_detection_checkpoint: true  num_steps: 800000  data_augmentation_options {    random_horizontal_flip {    }  }

然而,当我执行训练脚本时:

python object_detection/train.py     --logtostderr\--pipeline_config_path=/home/docs/car_dataset/models/model/faster_rcnn_resnet101_voc07.config\--train_dir=/home/docs/car_dataset/models/model/train\--num_gpus=2

我得到了以下错误:

tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file /home/docs/car_dataset/models/model/train: Failed precondition: /home/docs/car_dataset/models/model/train: perhaps your file is in a different file format and you need to use a different restore operator?

我还尝试设置目录中每个文件的路径

fine_tune_checkpoint: "/home/docs/car_dataset/models/model/train/model.ckpt.meta"

但我得到了以下错误:

tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file /home/docs/car_dataset/models/model/train/model.ckpt.meta: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?

在管道配置中,如何正确定义包含三个文件的预训练模型:(.data-00000-of-00001, .index, .meta)?

Tensorflow版本: 1.2.1


回答:

你需要做的就是指定完整路径,但不包括”.meta”、”.index”和”.data-00000-of-00001″扩展名。在你的情况下,应该是:”/home/docs/car_dataset/models/model/train/model.ckpt”(你会注意到这比目录更具体)。

Related Posts

L1-L2正则化的不同系数

我想对网络的权重同时应用L1和L2正则化。然而,我找不…

使用scikit-learn的无监督方法将列表分类成不同组别,有没有办法?

我有一系列实例,每个实例都有一份列表,代表它所遵循的不…

f1_score metric in lightgbm

我想使用自定义指标f1_score来训练一个lgb模型…

通过相关系数矩阵进行特征选择

我在测试不同的算法时,如逻辑回归、高斯朴素贝叶斯、随机…

可以将机器学习库用于流式输入和输出吗?

已关闭。此问题需要更加聚焦。目前不接受回答。 想要改进…

在TensorFlow中,queue.dequeue_up_to()方法的用途是什么?

我对这个方法感到非常困惑,特别是当我发现这个令人费解的…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注