tensorflow-deeplab-lfov icon indicating copy to clipboard operation
tensorflow-deeplab-lfov copied to clipboard

EOFError when using cPickle.load()

Open wangxy524 opened this issue 7 years ago • 3 comments

When I tried to use the converted model like "model.ckpt-init" or "model.ckpt-pretrained", I met the following error: Traceback (most recent call last): File "/home/wxy/Proj/test.py", line 21, in model = DeepLFOV(weights_path) ...... File "/home/wxy/Proj/test.py", line 53, in _create_variable weights = cPickle.load(f) # load pre-trained weights EOFError

wangxy524 avatar May 18 '18 12:05 wangxy524

make sure that the file is not corrupted; try to load it in a separate script and check its contents first

DrSleep avatar May 18 '18 23:05 DrSleep

I have tried several times in a separate script using two computer, but I still got the EOFError, And when I used the "vim" command to edit the file, I see [incomplete last line] [converted]. So I add a line break into the file, it still didn't work.

wangxy524 avatar May 19 '18 03:05 wangxy524

Sorry for misleading you - the docs have not been updated in a while: there are two ways of restoring weights, one is via the weights_path and another via restore_from. The weights_path loads the file using the pickle mechanism (after converting the weigths from Caffe), while restore_from uses the inner TensorFlow format. Now, the files that are provided are already in the TensorFlow format, so you do not need to pass the weights_path variable at all, just restore_from.

Let me know if you have any more questions

DrSleep avatar May 19 '18 05:05 DrSleep