Models: Can not restore pretrained model for Object Detection API

Created on 21 Jun 2017  路  8Comments  路  Source: tensorflow/models

I encounter this error when I execute train.py for fine tuning Oxford pet dataset using FasterRCNN Inception resnet V2.

DataLossError (see above for traceback): Unable to open table file /home/phong/TFZoo/model.ckpt.data-00000-of-00001: 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?

This is the command I used:
python object_detection/train.py --logtostderr --train_dir=/home/phong/TrainedModels/ --pipeline_config_path=faster_rcnn_inception_resnet_v2_atrous_pets.config

This is the part I edit on the config file:
`
train_config: {
batch_size: 1
optimizer {
momentum_optimizer: {
learning_rate: {
manual_step_learning_rate {
initial_learning_rate: 0.0003
schedule {
step: 0
learning_rate: .0003
}
schedule {
step: 900000
learning_rate: .00003
}
schedule {
step: 1200000
learning_rate: .000003
}
}
}
momentum_optimizer_value: 0.9
}
use_moving_average: false
}
gradient_clipping_by_norm: 10.0
fine_tune_checkpoint: "/home/phong/TFZoo/model.ckpt.data-00000-of-00001"
from_detection_checkpoint: true
data_augmentation_options {
random_horizontal_flip {
}
}
}

train_input_reader: {
tf_record_input_reader {
input_path: "/home/phong/pet/output/pet_train.record"
}
label_map_path: "/home/phong/pet/output/pet_label_map.pbtxt"
}

eval_config: {
num_examples: 2000
}

eval_input_reader: {
tf_record_input_reader {
input_path: "/home/phong/pet/output/pet_val.record"
}
label_map_path: "/home/phong/pet/output/pet_label_map.pbtxt"
}`
Please help me !

Most helpful comment

@phongnhhn92

For the fine_tune_checkpoint line in the config file, just write:
fine_tune_checkpoint: "/home/phong/TFZoo/model.ckpt"

(e.g., without the fine_tune_checkpoint: ".data-00000-of-00001" part)

All 8 comments

@phongnhhn92

For the fine_tune_checkpoint line in the config file, just write:
fine_tune_checkpoint: "/home/phong/TFZoo/model.ckpt"

(e.g., without the fine_tune_checkpoint: ".data-00000-of-00001" part)

Oh thanks ! It works like a charm.
I know this is out of scope question but for example. If I want to fine tuning this with my own dataset so I guess I have to construct my dataset the same format with VOC or Pet Oxford dataset. So I would like to ask is there any tools to help me to do that ?

Great!

We don't have any additional tools currently. The best thing to do is to read the examples that are provided for the Oxford-IIIT pets dataset and Pascal VOC.

To be honest, I have no idea how make my dataset with the same format with Pascal VOC. I hope there will be addition tool for this in the future.

I use this tool labelImg for annotating my own dataset. It generates XML files in the same format of Pascal VOC. Hope it helps. Cheers

Thanks ! @Nikhil-Kasukurthi I am looking for it

Closing this out, since it looks like the issue was resolved.

@jch1 your answer perfectly solve my problem in restoring tf model.
Thank u, thank u, thank u!!!

Was this page helpful?
0 / 5 - 0 ratings