thtrieu / darkflow

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
GNU General Public License v3.0
6.13k stars 2.08k forks source link

Error loading .pb and .meta files? #948

Closed Sreerag-ibtl closed 5 years ago

Sreerag-ibtl commented 5 years ago

I trained my model on colab. The prediction worked well using the .pb and .meta files. But when i tried prediction in the local machine, this error was shown:

Traceback (most recent call last):
  File "/home/sreerag/python36/darkflow_inference/on_small_plate.py", line 16, in <module>
    tfnet = TFNet( options )
  File "/home/sreerag/.local/lib/python3.6/site-packages/darkflow/net/build.py", line 54, in __init__
    self.build_from_pb()
  File "/home/sreerag/.local/lib/python3.6/site-packages/darkflow/net/build.py", line 83, in build_from_pb
    graph_def.ParseFromString(f.read())
google.protobuf.message.DecodeError: Error parsing message

where

options = { "pbLoad": '/path/to/yolo_custom.pb' ,           
           "metaLoad": '/path/to/yolo_custom.meta' ,
          }

Is this any issue regarding compatibility, since i trained the model in colab, or something else?

Sreerag-ibtl commented 5 years ago

I retrained the model and downloaded it again. It works now. I think the issue was that, the files are getting corrupted when downloaded from colab.