You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tvm.apache.org by Lixiaoquan via Apache TVM Discuss <no...@discuss.tvm.ai> on 2021/03/08 13:08:54 UTC

[Apache TVM Discuss] [Development/RFC] Introduce new frontend for Caffe


@zhupijuan_lkl When I run one of the tests in caffe test_forward.py, it reports an error from protobuf. I know it is not TVM's issue, really appreciate if you can give me some hint.

```
tvm/tests/python/frontend/caffe/test_forward.py:816: in _test_alexnet
    _test_network(data_process, proto_file, blob_file)
tvm/tests/python/frontend/caffe/test_forward.py:261: in _test_network
    tvm_out = _run_tvm(data, proto_file, blob_file)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

data = array([[[[  54.060997 ,  112.061    ,  -82.939    , ...,   37.060997 ,
           -69.939    ,  -78.939    ],
        ... [  54.32     ,   55.32     ,  126.32     , ...,  -32.68     ,
           -59.68     ,   -8.68     ]]]], dtype=float32)
proto_file = '/root/.tvm_test_data/model/alexnet.prototxt', blob_file = '/root/.tvm_test_data/model/alexnet.caffemodel'

    def _run_tvm(data, proto_file, blob_file):
        """ Run caffe model by TVM according to .caffemodel and .prototxt"""
        init_net = pb.NetParameter()
        predict_net = pb.NetParameter()
    
        # load model
        with open(proto_file, "r") as f:
            text_format.Merge(f.read(), predict_net)
        # load blob
        with open(blob_file, "rb") as f:
>           init_net.ParseFromString(f.read())
E           google.protobuf.message.DecodeError: Error parsing message

tvm/tests/python/frontend/caffe/test_forward.py:187: DecodeError
---------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------
File /root/.tvm_test_data/model/alexnet.prototxt exists, skip.
File /root/.tvm_test_data/model/alexnet.caffemodel exists, skip.
---------------------------------------------------------------------------------------------- Captured stderr call -----------------------------------------------------------------------------------------------
[libprotobuf ERROR google/protobuf/io/coded_stream.cc:207] A protocol message was rejected because it was too big (more than 67108864 bytes).  To increase the limit (or to disable these warnings), see CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h.

```





---
[Visit Topic](https://discuss.tvm.apache.org/t/introduce-new-frontend-for-caffe/6918/7) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/1461aae11e7b744960efc0e593144bb2fd9a0fc66ac4c987c35c8cbf7dbc5628).

[Apache TVM Discuss] [Development/RFC] Introduce new frontend for Caffe

Posted by zhupijuan_lkl via Apache TVM Discuss <no...@discuss.tvm.ai>.

[quote="lixiaoquan, post:7, topic:6918"]
`A protocol message was rejected because it was too big (more than 67108864 bytes)`
[/quote]

There are two mothods to solve this problem.:
1. follow the suggestion as error log: increase memory limits at CodedInputStream::SetTotalBytesLimit() and re-compile protobuf
2. upgrade protobuf into >= 3.2

Hope to help you





---
[Visit Topic](https://discuss.tvm.apache.org/t/introduce-new-frontend-for-caffe/6918/8) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/cf58a2aeb4e33d8eb69ea6c56161e919d9b6e60d99c2d316d29b87d3347e2693).