Ask Your Question
0

Inception V3 retrained model incorrect predictions after using optimize_for_inference and graph_transform tools

asked 2018-05-09 10:56:35 -0500

Henok gravatar image

updated 2018-05-11 16:52:36 -0500

Ladies and Gents, I have model generated using the tensorflow for poets tutorial. I have both binary and 3-class models that are exhibiting the same behavior.

The model performs as expected prior to transformation. Predicts well with up to 90 % accuracy. but soon as I transform that to be used with opencv dnn module, the predictions are way off, usually favoring one class over others.

I used the transforms described here: http://answers.opencv.org/question/17...

and here https://www.tensorflow.org/mobile/pre...

I'm wondering what the cause could be and how to maintain the inference performance when deploying the graph. Thank you.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-05-14 19:09:00 -0500

Henok gravatar image

The best workaround has been the following setup:

Once the network is transformed I used the call dnn::blobFromImage(img, 1.0f/128, (299,299),(128,128,128), true,false)

Also preprocessd image as follows:

img /=255 img -=0.5 img *= 2

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-05-09 10:56:35 -0500

Seen: 292 times

Last updated: May 14 '18