Skip to content
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

ParseError: 13:3 : Message type "caffe.LayerParameter" has no field named "image_data_lstm_param". #24

Closed
matthew-mcateer opened this issue Feb 7, 2020 · 3 comments

Comments

@matthew-mcateer
Copy link

matthew-mcateer commented Feb 7, 2020

Attempts at loading a model from the prototxt file, caffemodel file, and proto file have failed in a manner very similar to Issue #22

Expected Behavior

Running sh test_human16.sh . should produce the behavior described in the README.md.

Outside of this, given a .prototxt file, .caffemodel file, and .proto file for an arbitrary caffe model, it should be possible to use any of the various caffe2pytorch utilities (caffe2pytorch, pytorch-caffe, Caffe2Pytorch, deep-learning-model-convertor) to convert the caffe model to a pytorch model (as it does with the other caffe models that have been tested).

Current Behavior

In both cases, both running the model based on the README instructions and trying to convert the model, the code returns the following error:

ParseError: 13:3 : Message type "caffe.LayerParameter" has no field named "image_data_lstm_param".

Possible Solution

Only two results for image_data_lstm_param come up with a Google search. Both of them are from the 3d pose estimation repo. This suggests that these layer parameters are unique to this caffe model.

Steps to Reproduce

  1. Download repo with git clone https://github.com/chanyn/3Dpose_ssl.git
  2. Build 3Dssl Caffe & Install Tensorflow
  3. Download the appropriate Dataset and/or provided pre-trained models
  4. Multiple possible options for this step:
  • Run sh test_human16.sh . ../models/model_extension_mask3d/mask3d_iter_400000.caffemodel mask3d 5 as suggested in the README
  • Try converting model to Pytorch with a tool like pytorch-caffe
from caffenet import *

net = CaffeNet('../our2d/deploy2d.prototxt')
print(net)
net.load_weights('../our2d/2d_iter_800000.caffemodel')
net.eval()
import torch
import caffemodel2pytorch

model = caffemodel2pytorch.Net(
        prototxt = 'our2d/2d/template_16_merge.prototxt',
	weights = 'our2d/2d_iter_800000.caffemodel',
        caffe_proto = 'https://raw.githubusercontent.com/chanyn/3Dpose_ssl/master/caffe-3dssl/src/caffe/proto/caffe.proto'
)
model.cuda()
model.eval()
torch.set_grad_enabled(False)

All will result in the same error: ParseError: 13:3 : Message type "caffe.LayerParameter" has no field named "image_data_lstm_param".

Detailed Description

In the latest comment in Issue #22, the topic of "downloading the entire zip file" is brought up.

Not only does the protobuf file 3Dpose_ssl/caffe-3dssl/src/caffe/proto/caffe.proto appear to be out-of-date, but the following links from the README all seem to lack alternatives:

For all the zip files that did contain .prototxt and .caffemodel files, no combinations worked with the available caffe.proto.

Possible Implementation

Aside from attempting to manually reconstruct and retrain the model architecture from the paper details (which would be highly at-risk of error and/or deviation from the reported results), updating the protobuf file seems like both the quickest and least-risky fix.

Looking forward to the response, @kezewang & @chanyn

Context (Environment)

Both the README instructions and alternative Caffe-to-Pytorch conversions have been attempted in the following environments:

Environment 1: (Google Colab (pre-Caffe-installation))

  System:
    OS: Linux 4.14 Ubuntu 18.04.3 LTS (Bionic Beaver)
    CPU: (2) x64 Intel(R) Xeon(R) CPU @ 2.20GHz
    Memory: 10.12 GB / 12.72 GB
    Container: Yes
    Shell: 4.4.20 - /bin/bash
  Binaries:
    Node: 8.11.3 - /tools/node/bin/node
    npm: 5.7.1 - /tools/node/bin/npm
  Managers:
    Apt: 1.6.12 - /usr/bin/apt
    pip2: 19.3.1 - /usr/local/bin/pip2
    pip3: 19.3.1 - /usr/local/bin/pip3
  Utilities:
    CMake: 3.12.0 - /usr/local/bin/cmake
    Make: 4.1 - /usr/bin/make
    GCC: 7.4.0 - /usr/bin/gcc
    Git: 2.17.1 - /usr/bin/git
    Clang: 6.0.0-1ubuntu2 - /usr/bin/clang
    FFmpeg: 3.4.6 - /usr/bin/ffmpeg
  Languages:
    Bash: 4.4.20 - /bin/bash
    Java: 1.8.0_242 - /usr/bin/javac
    Perl: 5.26.1 - /usr/bin/perl
    Python: 3.6.9 - /usr/local/bin/python
    Python3: 3.6.9 - /usr/bin/python3
    R: 3.6.2 - /usr/local/bin/R

Environment 2: (Google Colab (post-Caffe-installation))

  System:
    OS: Linux 4.14 Ubuntu 18.04.3 LTS (Bionic Beaver)
    CPU: (2) x64 Intel(R) Xeon(R) CPU @ 2.20GHz
    Memory: 10.12 GB / 12.72 GB
    Container: Yes
    Shell: 4.4.20 - /bin/bash
  Binaries:
    Node: 8.11.3 - /tools/node/bin/node
    npm: 5.7.1 - /tools/node/bin/npm
  Managers:
    Apt: 1.6.12 - /usr/bin/apt
    pip2: 19.3.1 - /usr/local/bin/pip2
    pip3: 19.3.1 - /usr/local/bin/pip3
  Utilities:
    CMake: 3.12.0 - /usr/local/bin/cmake
    Make: 4.1 - /usr/bin/make
    GCC: 7.4.0 - /usr/bin/gcc
    Git: 2.17.1 - /usr/bin/git
    Clang: 6.0.0-1ubuntu2 - /usr/bin/clang
    FFmpeg: 3.4.6 - /usr/bin/ffmpeg
  Languages:
    Bash: 4.4.20 - /bin/bash
    Java: 1.8.0_242 - /usr/bin/javac
    Perl: 5.26.1 - /usr/bin/perl
    Python: 3.6.9 - /usr/local/bin/python
    Python3: 3.6.9 - /usr/bin/python3
    R: 3.6.2 - /usr/local/bin/R

Environment 3: (Local Linux Laptop)

 System:
    OS: Linux 4.15 Ubuntu 18.04.4 LTS (Bionic Beaver)
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 19.04 GB / 31.27 GB
    Container: Yes
    Shell: 4.4.20 - /bin/bash
  Binaries:
    Node: 8.17.0 - /usr/bin/node
    Yarn: 1.21.1 - /usr/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    Apt: 1.6.12 - /usr/bin/apt
    Cargo: 1.31.0 - ~/.cargo/bin/cargo
    CocoaPods: 1.7.3 - /usr/local/bin/pod
    Composer: 1.8.6 - /usr/local/bin/composer
    Gradle: 5.5 - /usr/local/bin/gradle
    Homebrew: 2.1.7 - /usr/local/bin/brew
    Maven: 3.6.1 - /usr/local/bin/mvn
    pip2: 18.1 - /usr/local/bin/pip2
    pip3: 20.0.1 - ~/anaconda3/bin/pip3
  Utilities:
    CMake: 3.10.2 - /usr/bin/cmake
    Make: 4.1 - /usr/bin/make
    GCC: 7.4.0 - /usr/bin/gcc
    Git: 2.17.1 - /usr/bin/git
  Virtualization:
    Docker: 19.03.5 - /usr/bin/docker
    VirtualBox: 5.2.34 - /usr/bin/vboxmanage
  IDEs:
    Android Studio: 3.1 AI-173.4907809
    Emacs: 25.2.2 - /usr/bin/emacs
    Nano: 2.9.3 - /bin/nano
    VSCode: 1.41.1 - /snap/bin/code
    Vim: 8.0 - /usr/bin/vim
  Languages:
    Bash: 4.4.20 - /bin/bash
    Java: 1.8.0_181 - /usr/bin/javac
    Perl: 5.26.1 - /usr/bin/perl
    Python: 3.7.2 - /home/mmcateer0/anaconda3/bin/python
    Python3: 3.7.2 - /home/mmcateer0/anaconda3/bin/python3
  Databases:
    MongoDB: 3.6.3 - /usr/bin/mongo
    SQLite: 3.26.0 - /home/mmcateer0/anaconda3/bin/sqlite3
  Browsers:
    Chrome: 80.0.3987.87
    Firefox: 72.0.2

Given the consistency of the problem between environments, it does not seem that reconfiguring Caffe installation is a viable solution to this.

@kezewang
Copy link
Collaborator

kezewang commented Feb 7, 2020

Could you check the whole project zip file for more details?
https://www.dropbox.com/s/qycpjinof2ishw9/3Dpose_ssl.tar.gz?dl=0

@matthew-mcateer
Copy link
Author

Thank you for the link! And thank you for updating the link in the README.md! I will see if this fixes it.

Is this caffe.proto built for the files in the /models in the unzipped 3Dpose_ssl.tar.gz file? or should it also work with the ones from the Google drive links in the README?

(will provide updates on how the contents of this folder work)

@matthew-mcateer
Copy link
Author

Access to the new files fixed things. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants