DecodeError: Error parsing message

See original GitHub issue

Hello, I’m trying to run the model but I get the following error

020-06-22 00:20:45.880699: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1
[TransNetV2] Using weights from transnetv2-weights/.
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/saved_model/loader_impl.py", line 98, in parse_saved_model
    saved_model.ParseFromString(file_content)
google.protobuf.message.DecodeError: Error parsing message

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "transnetv2.py", line 188, in <module>
    main()
  File "transnetv2.py", line 160, in main
    model = TransNetV2(args.weights)
  File "transnetv2.py", line 17, in __init__
    self._model = tf.saved_model.load(model_dir)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/saved_model/load.py", line 578, in load
    return load_internal(export_dir, tags)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/saved_model/load.py", line 588, in load_internal
    loader_impl.parse_saved_model_with_debug_info(export_dir))
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/saved_model/loader_impl.py", line 56, in parse_saved_model_with_debug_info
    saved_model = _parse_saved_model(export_dir)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/saved_model/loader_impl.py", line 101, in parse_saved_model
    raise IOError("Cannot parse file %s: %s." % (path_to_pb, str(e)))
OSError: Cannot parse file b'transnetv2-weights/saved_model.pb': Error parsing message.

Any idea on what could be wrong? thanks

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
soCzechcommented, Jun 22, 2020

Ok, I retested the code by running the following and it works perfectly:

git --version
# >> git version 2.20.1 (older versions do not download lfs files automatically)
git clone git@github.com:soCzech/TransNetV2.git
cd TransNetV2/
# nvidia-docker is required!
docker build -t transnet -f inference/Dockerfile .
docker run -it --rm --gpus 1 -v /home/videos:/tmp transnet transnetv2_predict /tmp/test_video.mp4 --visualize

You may need to redownload the transnetv2-weights directory as the files could be corrupted.

Here are sha256 sums for check (get them by running sha256sum _file_):

8ac2a52c5719690d512805b6eaf5ce12097c1d8860b3d9de245dcbbc3100f554  saved_model.pb
b8c9dc3eb807583e6215cabee9ca61737b3eb1bceff68418b43bf71459669367  variables/variables.data-00000-of-00001
8b99e28b4ad11372d9a1ad9703298c2e370df14859da4245fdbe818e92dd403f  variables/variables.index

Did that solve your issue?

1reaction
NXTNiklascommented, Apr 19, 2021

Hello, I’ve got the same Issue and was able to solve it with the following commands:

git clone https://github.com/soCzech/TransNetV2.git cd TransNetV2 git lfs fetch https://github.com/soCzech/TransNetV2.git git lfs checkout

The problem is, that the files are to big for normal storing and are stored in githubs large file storage (lfs). When running on colab like I did, it only downloads the pointer files. The commands above solve that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix: "google.protobuf.message.DecodeError: Error ...
protobuf. message. DecodeError: Error parsing message" when creating tensorflow text summary - Stack Overflow. Collectives™ on Stack Overflow – ...
Read more >
google.protobuf.message.DecodeError: Error parsing ... - GitHub
I trained the model and saved it, now I am trying to load but unable to do. I have seen in previous post...
Read more >
Error parsing message with type 'tensorflow.GraphDef'
I was training the model and saved it, now I am trying to load but unable to do. I have seen in previous...
Read more >
Unable to get frozen inference graph + Tensorflow1.0
I am facing below issue. google.protobuf.message.DecodeError: Error parsing message with type 'tensorflow.GraphDef' Command used to perform ...
Read more >
Python google.protobuf.message.DecodeError() Examples
This page shows Python examples of google.protobuf.message.DecodeError.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found