Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Keras->Tensorflow->OpenCV conversion is still shaky. The Keras->Tensorflow conversion is not very optimal, so it adds lots of layers that OpenCV has difficulty to understand (especially the Flatten operation).

To create a network that OpenCV can understand, first you need to freeze the tensorflow graph and optimize it for inference. See this issue for code describing how to do it correctly.

The link above also gives some hints to eliminate the problems introduced by the Flatten layer.

Keras->Tensorflow->OpenCV conversion is still shaky. The Keras->Tensorflow conversion is not very optimal, so it adds lots of layers that OpenCV has difficulty to understand (especially the Flatten operation).

To create a network that OpenCV can understand, first you need to freeze the exported tensorflow graph and optimize it for inference. See this issue for code describing how to do it correctly.

The link above also gives some hints to eliminate the problems introduced by the Flatten layer.