Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

How to create a quantized model in order to try out QNNPACK? #12

Closed
fengxueem opened this issue Nov 2, 2018 · 13 comments
Closed

How to create a quantized model in order to try out QNNPACK? #12

fengxueem opened this issue Nov 2, 2018 · 13 comments

Comments

@fengxueem
Copy link

Hi,
I am so excited that Facebook is revealing its own magic on mobile inference framework. After reading the article about QNNPACK, I really want to try it out on my own caffemodel.(I know that you guys have posted quantized mobilenetv2, and it beats the TFLITE one by 2x.) But how can I convert my prototxt and caffemodel to the preferred model format which can be applied to QNNPACK?

@Maratyszcza
Copy link
Contributor

We haven't released the tooling for converting floating-point models to quantized (8-bit) models yet. You may use QNNPACK with the two pre-trained models that we released:

@biaoxiaoduan
Copy link

I got this error when I tried ResNet-50 model as you mentioned above.
terminate called after throwing an instance of 'c10::Error' what(): [enforce fail at operator.cc:46] blob != nullptr. op NCHW2NHWC: Encountered a non-existing input blob: gpu_0/data_0 (no backtrace available)
mobilenet_v2 is OK

@Maratyszcza
Copy link
Contributor

@biaoxiaoduan In quantized ResNet-50 the input blob is called "gpu_0/data_0" rather than "data".

@xiezheng-cs
Copy link

Hi,
I am so excited that Facebook is revealing its own magic on mobile inference framework. After reading the article about QNNPACK, I really want to try it out on my own caffemodel.(I know that you guys have posted quantized mobilenetv2, and it beats the TFLITE one by 2x.) But how can I convert my prototxt and caffemodel to the preferred model format which can be applied to QNNPACK?

Hi, I have the same problem. Do you have any idea to solve it?

@Maratyszcza
Copy link
Contributor

@xiezheng-cs As of today, there's no out-of-the-box solution for Caffe2 or PyTorch, but team is working on it

@hardsetting
Copy link

Hi, do you have any updates on a tool, or have any suggestions in how to manually convert an onnx model to use quantized 8bit integers?

@hlu1
Copy link
Contributor

hlu1 commented Feb 12, 2019

ONNX doesn't support quantization as of today. Any chance you can convert the model to caffe2 and quantize it to 8bit using caffe2?

@hardsetting
Copy link

Do you have any estimate on when quantization will be available on onnx? Our main model was not written for caffe2 unfortunately.

@bddppq
Copy link

bddppq commented Feb 12, 2019

@hardsetting Quantization support in onnx is unfortunately on hold right now, sorry we don't have any eta on it :( .

@hardsetting
Copy link

Luckily I just managed to convert my model to Caffe2. What about the conversion tool from regular Caffe2 model to quantized Caffe2 model @Maratyszcza was referring to? Do you have an ETA for that or any news?

@hlu1
Copy link
Contributor

hlu1 commented Feb 12, 2019

The latest ETA is one to two months :(

@hardsetting
Copy link

Ok, thank you for the answer

@zhoujinhai
Copy link

Luckily I just managed to convert my model to Caffe2. What about the conversion tool from regular Caffe2 model to quantized Caffe2 model @Maratyszcza was referring to? Do you have an ETA for that or any news?

I have the same problem, Do you have solved it?

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

No branches or pull requests

8 participants