Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

Model returns all zeroes

mfoglio
New Contributor I
739 Views

I am trying to use EfficientDet-d0 in OpenVINO. However, my output returns all zeroes.

Code to load the model:

_ie = IECore()
model = _ie.read_network(model_xml, model_bin). # path to files
_input_layer_name, _output_layer_names = next(iter(model.input_info)), sorted(model.outputs)

openvino_config = {'device_name': 'CPU', 'num_requests': 0}
openvino_config["network"] = model
_engine = _ie.load_network(**openvino_config)

How I use the model:

numpy_frame = cv2.resize(numpy_frame, (224, 224)
numpy_frame = numpy_frame / 255.0
numpy_frame = numpy_frame.transpose(2, 0, 1)
results = _engine.infer(inputs={_input_layer_name: numpy_frame})


The ouput `results["detections"]` is a matrix of 0.

I generated the model using:

git clone https://github.com/google/automl
cd automl/efficientdet

git checkout 96e1fee

python3 -m venv venv
source venv/bin/activate

curl https://bootstrap.pypa.io/get-pip.py | python -

python3 -m pip install numpy
python3 -m pip install -r requirements.txt
python3 -m pip install tensorflow-model-optimization
python3 -m pip install networkx defusedxml
python3 -m pip install test-generator==0.1.1

wget https://storage.googleapis.com/cloud-tpu-checkpoints/efficientdet/coco2/efficientdet-d0.tar.gz
tar zxvf efficientdet-d0.tar.gz

python3 model_inspect.py --runmode=saved_model --model_name=efficientdet-d0 --ckpt_path=efficientdet-d0 --saved_model_dir=savedmodeldir

export MO_ROOT=/opt/intel/openvino_2021.3.394/deployment_tools/model_optimizer/
export IMAGE_SIZE=512

python3 $MO_ROOT/mo.py \
--input_shape=[1,512,512,3] \
--input=image_arrays \
--reverse_input_channels \
--input_model savedmodeldir/efficientdet-d0_frozen.pb \
--transformations_config $MO_ROOT/extensions/front/tf/automl_efficientdet.json \
--output_dir openvino_model

 

Thanks 

0 Kudos
2 Replies
mfoglio
New Contributor I
713 Views

Problem solved: there is no need to normalize the image by dividing by 255.

0 Kudos
IntelSupport
Community Manager
695 Views

Hi mgoglio,

I am glad that you are able to solve that and thanks for sharing the information in this community. This thread will no longer be monitored since this issue has been resolved. If you need any additional information from Intel, please submit a new question.

 

Regards,

Aznie


0 Kudos
Reply