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

使用LSTM在Python中预测未来值

这段代码可以预测指定股票的当前日期之前的值,但不能预测…

如何在gensim的word2vec模型中查找双词组的相似性

我有一个word2vec模型,假设我使用的是googl…

dask_xgboost.predict 可以工作但无法显示 – 数据必须是一维的

我试图使用 XGBoost 创建模型。 看起来我成功地…

ML Tuning – Cross Validation in Spark

我在https://spark.apache.org/…

如何在React JS中使用fetch从REST API获取预测

我正在开发一个应用程序,其中Flask REST AP…

如何分析ML.NET中多类分类预测得分数组?

我在ML.NET中创建了一个多类分类项目。该项目可以对…

发表回复

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