-
Notifications
You must be signed in to change notification settings - Fork 45.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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? #2676
Comments
File format is inconsistent,Look at posts: slim.get_or_create_global_step() change to: tf.train.get_or_create_global_step() |
@wpq3142
I don't dive into the implementation of this API, but I suppose this API is for new format. |
I'm assuming the model code here would need to be updated to maybe determine which format the checkpoint is written in, and if so, use the correct API? If so, that sounds like a straightforward change and we'd welcome contributions helping to clean up the model. |
@wpq3142 Can you tell us how you are configuring this particular entry in the config: It should look like Moreover, it also looks like you are using |
I downloaded the latest model,It's working right now,Configuration is as follows: For one reason, I seem to lack a space between keys and values, |
you just need to restore (.ckpt) not (.ckpt.meta) |
Apparently in V2 checkpoints, you should only include the filename up to ".ckpt". For instance if the checkpoint filename is |
@pbashivan thank you so much |
I have fixed the issue by this: |
Solved on #7696 |
Hello all, just follow the below video and export your own model with in a 10 seconds |
This works, and in my case, I used the longest common prefix among my check point related files which was
I just thought this might be the case for some folks. |
I was running into this and this worked for me. All I had to do was run the following on my windows 10 x64 machine and it worked: python export_inference_graph.py --input_type image_tensor --pipeline_config_path ssd_mobilenet_v1_coco.config --trained_checkpoint_prefix models\model.ckpt-1000 --output_directory tuned_model Instead of: python export_inference_graph.py --input_type image_tensor --pipeline_config_path ssd_mobilenet_v1_coco.config --trained_checkpoint_prefix models\model.ckpt-1000.data-###-### --output_directory tuned_model tl;dr Dont reference single files in the --trained_checkpoint_prefix flag. Just reference the batch (the prefix) of those three files. Hope it helps. |
@phosseini is correct. The model itself is made up of three different files with three different extensions showing what kind of model data each file stores. For me too, using the longest shared file name prefix solved the issue.
|
tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file ./model_dir/model.ckpt-1000000.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 trying to run opened project properly, the code saved files as model-10.data-0000-of-0001, .index, .meta.
One of solution in this issue is to change the file name. model.ckpt-1000000.data-00000-of-00001 How to touch the code in my situation? How to change the file name? It looks the save method determine file name automatically. Or should i change the file name manually? ///////////////////////////////////////////////////////////////////////////////////////////// It can be
but not enough
cur_model is 'model.ckpt-50.data-0000-of-0001', .index, .meta.
Just include file name in restore. cur_model2 is 'model.ckpt-50' |
none of the above worked. |
you are a legend |
in some models, it could also be caused by lacking a .meta file and / or a .index file. |
Please all, |
@Rajput245 I have the same problem. Were you able to fix it? |
Hi guys, I don't know if it is still a problem for you, but I had the following files: When I used the following code:
I hope this helps you! |
I would maybe try to just add the ckpt after 'variables'. |
I just resolved this issue. I saved the model as a .h5 file and that worked. |
import tensorflow as tf |
…(via correct filename input, tensorflow/models#2676)
System information
python3 object_detection/train.py
--clone_on_cpu true
--logtostderr
--pipeline_config_path /home/wpq/data/potato/model/rfcn_resnet101_coco.config
--train_dir /home/wpq/data/potato/model/train
Describe the problem
download the new :faster_rcnn_inception_resnet_v2_atrous_coco_11_06_2017.tar.gz
rfcn_resnet101_coco.config :
model {
faster_rcnn {
num_classes: 37
image_resizer {
keep_aspect_ratio_resizer {
min_dimension: 600
max_dimension: 1024
}
}
feature_extractor {
type: 'faster_rcnn_inception_resnet_v2'
first_stage_features_stride: 8
}
Source code / logs
2017-11-01 15:11:40.186072: W tensorflow/core/util/tensor_slice_reader.cc:95] Could not open /home/wpq/data/potato/data/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?
Traceback (most recent call last):
File "/home/wpq/workspace/models-master/research/object_detection/train.py", line 163, in
tf.app.run()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "/home/wpq/workspace/models-master/research/object_detection/train.py", line 159, in main
worker_job_name, is_chief, FLAGS.train_dir)
File "/home/wpq/workspace/models-master/research/object_detection/trainer.py", line 254, in train
var_map, train_config.fine_tune_checkpoint))
File "/home/wpq/workspace/models-master/research/object_detection/utils/variables_helper.py", line 122, in get_variables_available_in_checkpoint
ckpt_reader = tf.train.NewCheckpointReader(checkpoint_path)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 150, in NewCheckpointReader
return CheckpointReader(compat.as_bytes(filepattern), status)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/errors_impl.py", line 473, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file /home/wpq/data/potato/data/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?
Process finished with exit code 1
The text was updated successfully, but these errors were encountered: