models icon indicating copy to clipboard operation
models copied to clipboard

issue in Pre-trained model checkpoint version not work with tensorflow-1.2

Open rajvi3105 opened this issue 9 years ago • 24 comments

Hello all,

I am newbie in tensorflow. I use tensorflow-1.2 version and want to train my own data. And use the pre-train model ssd_mobilenet_v1_coco. At the training time i got the error: tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file /usr/local/lib/python2.7/dist-packages/tensorflow/models/model/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?

I read some related stack overflow post and written that:

add lines: saver = tf.train.Saver(Write_version = saver_pb2.SaveDef.V1) saver.save(sess,"./model.ckpt",global_step=step)

But, I am not getting where to add this lines in saver.py and Do I need to remove any line from this file.

Any help solving this problem would be appreciated.

Thanks in advance.

rajvi3105 avatar Aug 17 '17 05:08 rajvi3105

Can you fill out the new issue template? In particular, are you running your own code or code from the repo?

skye avatar Aug 17 '17 19:08 skye

Hi skye,

I follow Mr. Dat Tran object detection blog, download the image dataset and .xml files from his repo. I followed the exact instructions given in blog, only I try to train model locally. But there I get the error as I mentioned.

Thank You.

rajvi3105 avatar Aug 18 '17 10:08 rajvi3105

I got the same error, also waiting for some advice

wyhgood avatar Aug 22 '17 02:08 wyhgood

Actually I am reading that too. Just specify model.ckpt in the .config file

shuuchen avatar Aug 22 '17 07:08 shuuchen

model.ckpt is just renaming of model.ckpt.data-00000-of-00001 file. But the problem is model.ckpt.data-00000-of-00001 is in old format and tensorflow-1.2 object-detection required new format. Unfortunately, new formaat of model.ckpt.data-00000-of-00001 is not available till now.

rajvi3105 avatar Aug 22 '17 07:08 rajvi3105

I am not very familiar with the object detection model or blog. Can you post the exact instructions for reproducing this problem? (This is also requested in the issue template.)

skye avatar Aug 22 '17 17:08 skye

Hi, I am running into the same problem. I am following this link https://github.com/tensorflow/models/blob/master/object_detection/g3doc/running_locally.md to retrain the object detection model. I downloaded "rfcn_resnet101_coco" from here, which gave me four files: -frozen_inference_graph.pb -graph.pbtxt -model.ckpt.data-00000-of-00001 -model.ckpt.meta -model.ckpt.index As suggested in the documentation , fine_tune_checkpoint should be path to "/usr/home/username/checkpoint/model.ckpt-#####". BUT If I give "fine_tune_checkpoint=file_path/model.ckpt.data-00000-of-00001", it throws this : tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file ~/Documents/trained_models/faster_rcnn_resnet101_coco_11_06_2017/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? I am using TensorFlow version 1.3.0 on Ubuntu 16.04 with cudnn5.1. Any help appreciated.

Thanks

skulhare avatar Aug 25 '17 23:08 skulhare

Just giving the path : fine_tune_checkpoint=file_path/model.ckpt, worked for me.

skulhare avatar Aug 29 '17 21:08 skulhare

hi skulhae,

Which tensorflow version and OS are you using?

I already set the fine_tune_checkpoint = ${path_to_model.ckpt} not worked for me :(

rajvi3105 avatar Aug 30 '17 08:08 rajvi3105

I am using TensorFlow version 1.3.0 on Ubuntu 16.04 with cudnn5.1.

skulhare avatar Aug 30 '17 16:08 skulhare

Where did you get the model ckpt file from?

drpngx avatar Sep 07 '17 01:09 drpngx

@drpngx I have the same issue. I downloaded it from model zoo, ssd_mobilenet_v1_coco

iamtodor avatar Mar 07 '18 15:03 iamtodor

@suharshs reassigning to you since it looks like you might have touched the model last?

drpngx avatar Mar 07 '18 19:03 drpngx

I haven't touched the ssd models so am unfamiliar with this issue :( @iamtodor what is the exact command you are running so we can repro? Thanks

suharshs avatar Mar 07 '18 21:03 suharshs

@suharshs Thank you for attantion. Here is my command.

python models/research/object_detection/train.py --logtostderr --pipeline_config_path=ssd_mobilenet/ssd.config --train_dir=data

My ssd.config. Dir data contains following files:

$ ls data
class.pbtxt	pipeline.config	test.record	train.record

Is there something else I could provide to you?

iamtodor avatar Mar 12 '18 09:03 iamtodor

My files are like this ls $TRAIN_DIR

model.ckpt-4513245.data-00000-of-00001
model.ckpt-4513245.index
model.ckpt-4513245.meta

What works to me is to just set CKPT_FILE=${TRAIN_DIR}/model.ckpt-4513245 Then python eval_image_classifier.py --alsologtostderr --checkpoint_path=${CKPT_FILE} --dataset_dir=${DATA_DIR} --dataset_name=mnist --dataset_split_name=test --model_name=lenet works

Tensorflow-gpu 1.4, Ubuntu 16.04

leyuan avatar Jul 19 '18 16:07 leyuan

@rajvi3105 Please consider using latest checkpoint files in Model Detection Zoo and steps in the blog post we published recently.

achowdhery avatar Aug 01 '18 20:08 achowdhery

Closing this issue, feel free to reopen if encountering any issues with checkpoint files.

wt-huang avatar Oct 08 '18 00:10 wt-huang

ssd_mobilenet_v1_coco_2018_01_28 don't know the checkpoints?

Shubhamrock428 avatar Oct 08 '18 19:10 Shubhamrock428

model.ckpt is just renaming of model.ckpt.data-00000-of-00001 file. But the problem is model.ckpt.data-00000-of-00001 is in old format and tensorflow-1.2 object-detection required new format. Unfortunately, new formaat of model.ckpt.data-00000-of-00001 is not available till now.

What is the situation now? Is this issue resolved? - Thanks in advance

pru007 avatar Jan 24 '19 12:01 pru007