hizhangp / yolo_tensorflow

Tensorflow implementation of YOLO, including training and test phase.
MIT License
799 stars 442 forks source link

error loading the weight file (successfully trained with own dataset and saved)when doing the test #10

Closed CompilerBian closed 7 years ago

CompilerBian commented 7 years ago

I have successfully trained the model with my own dataset(which have two classes)and saved the weight file. But when I loaded the saved model to conduct testing, something wrong with the weight file

/core/util/tensor_slice_reader.cc:95] Could not open ./data/weights/save.ckpt: 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?

The error appears in the line:

self.saver.restore(self.sess, self.weights_file)

The version of tensorflow I am currently using is 1.2. I'm not sure if it's the version problem(I have searched on the Internet for this error and found the same problems related to the version of tensorflow ). Could you help me with this issue and how to restore weight files which have been trained?

hizhangp commented 7 years ago

It is mainly because of the incompatible betweenwrite_version V1 and V2 in tf.traion.Saver, changing weight_file into the format of save.ckpt-001000 will be helpful, the number 001000 depends on the name of checkpoint.

leeyoshinari commented 7 years ago

I also meet this problem. Can you tell me how to solve the problem, and how to change the write_version V1 or V2? @hizhangp @CompilerBian