Repository: pytorch
Issue: [Caffe2] convert ONNX to caffe2
Labels: caffe2

I used this program to generate pb model.

> convert-caffe2-to-onnx trainednet.onnx --output predict_net.pb

My Error
```

WARNING:root:This caffe2 python run does not have GPU support. Will run in CPU only mode.
WARNING:root:Debug message: No module named caffe2_pybind11_state_gpu
Traceback (most recent call last):
  File "/Users/rafalpilarczyk/anaconda3/envs/caffe2/bin/convert-caffe2-to-onnx", line 11, in <module>
    sys.exit(caffe2_to_onnx())
  File "/Users/rafalpilarczyk/anaconda3/envs/caffe2/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/rafalpilarczyk/anaconda3/envs/caffe2/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/rafalpilarczyk/anaconda3/envs/caffe2/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/rafalpilarczyk/anaconda3/envs/caffe2/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/rafalpilarczyk/anaconda3/envs/caffe2/lib/python2.7/site-packages/onnx_caffe2/bin/conversion.py", line 42, in caffe2_to_onnx
    c2_net_proto.ParseFromString(caffe2_net.read())
  File "/Users/rafalpilarczyk/anaconda3/envs/caffe2/lib/python2.7/site-packages/google/protobuf/message.py", line 185, in ParseFromString
    self.MergeFromString(serialized)
  File "/Users/rafalpilarczyk/anaconda3/envs/caffe2/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 1083, in MergeFromString
    if self._InternalParse(serialized, 0, length) != length:
  File "/Users/rafalpilarczyk/anaconda3/envs/caffe2/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 1120, in InternalParse
    pos = field_decoder(buffer, new_pos, end, self, field_dict)
  File "/Users/rafalpilarczyk/anaconda3/envs/caffe2/lib/python2.7/site-packages/google/protobuf/internal/decoder.py", line 612, in DecodeRepeatedField
    if value.add()._InternalParse(buffer, pos, new_pos) != new_pos:
  File "/Users/rafalpilarczyk/anaconda3/envs/caffe2/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", line 1109, in InternalParse
    new_pos = local_SkipField(buffer, new_pos, end, tag_bytes)
  File "/Users/rafalpilarczyk/anaconda3/envs/caffe2/lib/python2.7/site-packages/google/protobuf/internal/decoder.py", line 850, in SkipField
    return WIRETYPE_TO_SKIPPER[wire_type](buffer, pos, end)
  File "/Users/rafalpilarczyk/anaconda3/envs/caffe2/lib/python2.7/site-packages/google/protobuf/internal/decoder.py", line 820, in _RaiseInvalidWireType
    raise _DecodeError('Tag had invalid wire type.')
google.protobuf.message.DecodeError: Tag had invalid wire type.
```

I have similar issues with ONNX-MXNet and tensorflow. I assume that my ONNX model is not compatible with current onnx_caffe2 module? I exported this model using Matlab ONNX exporter. https://www.mathworks.com/matlabcentral/fileexchange/67296-neural-network-toolbox-converter-for-onnx-model-format

I work on MacOS with conda enviroment, python 2.7.15.  I tried this also on virtual machine with P4000, Cuda 9.0 and 9.1, but results were the same.