我正在尝试按照这些说明从现有检查点训练模型。
我已经使用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”(你会注意到这比目录更具体)。