OpenCV dnn Load Quantized Tensorflow model?

asked 2017-11-30 05:39:27 -0600

Is it possible to load quantized models into opencv at the moment?

I can load a model i trained with tensorflow, but once i quantize the weights, i get the following error:

OpenCV Error: Unspecified error (Unknown layer type Dequantize in op conv2d_1/kernel/read/_41__cf__41) in populateNet, file /home/zsolt/Downloads/dockerfile/opencv_complete/opencv/modules/dnn/src/tensorflow/tf_importer.cpp, line 1299

To me it looks like the "Dequantize" layer is not implemented yet (also I have not seen it in the docs). Is support for this planned in the future? Or How do other people deal with this?

edit retag flag offensive close merge delete

Comments

@gorbad-6, Currently we haven't tried to load models with quantized weights. In terms of TensorFlow it's not a layer but a graph node. May I ask you to open an issue with a feature request at https://github.com/opencv/opencv/issues? Please add a model reference or a way to quantize model weights there.

dkurt gravatar imagedkurt ( 2017-12-01 04:56:13 -0600 )edit
1

@dkurt thank you for the reply! sure. i will do it in the course of this week and link the issue here.

gorbad-6 gravatar imagegorbad-6 ( 2017-12-04 02:23:36 -0600 )edit
gorbad-6 gravatar imagegorbad-6 ( 2017-12-07 01:44:16 -0600 )edit