Skip To Main Content
Support Knowledge Base

Wrong Prediction When Inferencing with Converted Keras* Model

Content Type: Troubleshooting   |   Article ID: 000089134   |   Last Reviewed: 05/20/2022

Description

  • Correct result when inferencing with original Keras model.
  • Converted the Keras model into Intermediate Representation.
  • Wrong result when inferencing with the converted model.

Resolution

Most TensorFlow models are trained with images in RGB order.

By default, Inference Engine samples and demos expect input with BGR channels order.

Method 1:
Convert the model using the Model Optimizer tool with --reverse_input_channels argument. 

Method 2:
Change from RGB to BGR: 

im_cv = cv.imread('test2.jpg')
frame = cv.cvtColor(im_cv, cv.COLOR_RGB2BGR)

Additional information

Related Products

This article applies to 2 products.

Discontinued Products

Intel® Developer Cloud for the Edge