IBM / AccDNN

A compiler from AI model to RTL (Verilog) accelerator in FPGA hardware with auto design space exploration.
Apache License 2.0
399 stars 101 forks source link

Core dump error occured with some Caffe models #3

Closed zhangjlcn closed 5 years ago

zhangjlcn commented 5 years ago

OS: CentOS7.4 Kernel: 3.10.0-693.el7 Caffe version: https://github.com/BVLC/caffe.git rc3 Python version: 2.7.5 AccDNN version: git commit with 9520ecd844448089e8b972718a0791936460a9d1 Vivado version: 2017.4

Problem description: When using codegen.py to generate verilog code with caffe model, core dump error occured.

With the caffe model in example/alexnet, error messages like follows: [libprotobuf ERROR google/protobuf/text_format.cc:245] Error parsing text-format caffe.NetParameter: 6:15: Message type "caffe.LayerParameter" has no field named "input_param". WARNING: Logging before InitGoogleLogging() is written to STDERR F1008 13:29:24.524755 20949 upgrade_proto.cpp:68] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: deploy.prototxt Check failure stack trace: Aborted (core dumped)

And with the model in example/cifar10-quantized, the follows is the error informations: [libprotobuf ERROR google/protobuf/text_format.cc:245] Error parsing text-format caffe.NetParameter: 26:22: Message type "caffe.LayerParameter" has no field named "quantization_param". WARNING: Logging before InitGoogleLogging() is written to STDERR F1008 13:32:43.952024 21338 upgrade_proto.cpp:68] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: quantized_A16C8F4.prototxt Check failure stack trace: Aborted (core dumped)

I wondered is the version diffrences of Caffe cause the above? And how can i reslove these problem?

Thanks!

Junsong-Wang commented 5 years ago

The official BVLC caffe version only supports un-quantized model, which will use default quantization. For quantized model, please use https://github.com/pmgysel/caffe. To avoid any issue, please install ristretto Caffe.

zhangjlcn commented 5 years ago

Thanks for your reply. While, i try to use ristretto Caffe to convert the example/alexnet, the error aboved also occured:

[libprotobuf ERROR google/protobuf/text_format.cc:245] Error parsing text-format caffe.NetParameter: 6:15: Message type "caffe.LayerParameter" has no field named "input_param". WARNING: Logging before InitGoogleLogging() is written to STDERR F1008 15:30:25.813431 7127 upgrade_proto.cpp:68] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: deploy.prototxt Check failure stack trace: Aborted (core dumped)

The caffe version: https://github.com/pmgysel/caffe.git with tag rc3 My command like follows: python codegen.py example/alexnet/deploy.prototxt example/alexnet/caffe_alexnet_train_iter_450000.caffemodel --optim_file example/alexnet/optim_alexnet.conf --batch_size 1

Thanks for your help.

Junsong-Wang commented 5 years ago

rc3 is still the old version from BVLC, there is no definition of "input_param" in LayerParameter . https://github.com/pmgysel/caffe/blob/rc3/src/caffe/proto/caffe.proto#L310

Please use the master branch, it should have the definition of "input_param" in LayerParameter. https://github.com/pmgysel/caffe/blob/master/src/caffe/proto/caffe.proto#L327

zhangjlcn commented 5 years ago

Problem resloved. Thanks.