onnx / onnx-caffe2

Caffe2 implementation of Open Neural Network Exchange (ONNX)
Other
165 stars 66 forks source link

onnx-caffe2 is slower? #152

Open hyer opened 6 years ago

hyer commented 6 years ago

I try to run this tutorial:Example: End-to-end AlexNet from PyTorch to Caffe2 However, I found the reference speed of onnx-caffe2 is 10x slower than the origin pytorch model. Anyone help? Thanks. If the reference time is comparable, It would be great to deploy models of Pytorch using Caffe2.

My Machine:

Ubuntu 14.04 CUDA 8.0 cudnn 7.0.3 Caffe2 latest Pytorch 0.3.0

nebulaf91 commented 6 years ago

I found the same issue. When I convert my model from pytorch to caffe2 using onnx-caffe2, caffe2 running time is about 30% slower than pytorch. I guess maybe the onnx auto-generated net structure is not well optimized, so it is more complex than the original pytorch model definition.