openvinotoolkit / openvino

OpenVINO™ is an open-source toolkit for optimizing and deploying AI inference
https://docs.openvino.ai
Apache License 2.0
7.06k stars 2.22k forks source link

[Bug] floordiv_3 (Floor) types check error: input #0 has type S32, but FP16 is expected #12095

Closed LinBaoxin closed 1 year ago

LinBaoxin commented 2 years ago
System information (version)
Detailed description

Hi there, When I tried running my IR model on NCS2, I saw the following error:

RuntimeError: StatefulPartitionedCall/floordiv_3 of type Floor: [ GENERAL_ERROR ] C:\j\workspace\private-ci\ie\build-windows-vs2019@3\b\repos\openvino\src\plugins\intel_myriad\graph_transformer\src\model\stage.cpp:305 Stage node StatefulPartitionedCall/floordiv_3 (Floor) types check error: input #0 has type S32, but FP16 is expected

There is a similar issue #7799.

Steps to reproduce

The model I used is downloaded from Tensorflow Hub. Tensorflow Document Page: MoveNet: Ultra fast and accurate pose detection model I converted the movenet_multipose_lightning_1.tar.gz SavedModel (TF 2. x) format to movenet_multipose_192x256.pb PB format (TF 1. x) format and then convert it to IR format.

Here is the command:

mo --input_model "movenet_multipose_192x256.pb" --input_shape "[1,192,256,3]" --data_type FP16

Here is the code:

from openvino.runtime import Core

import numpy as np
import time

ie = Core()
model = ie.read_model(model="movenet_multipose_192x256.xml", weights="movenet_multipose_192x256.bin")
compiled_model = ie.compile_model(model=model, device_name='CPU')
# compiled_model = ie.compile_model(model=model, device_name='MYRIAD')
input_key = compiled_model.input(0)
output_key = compiled_model.output(0)

image = np.random.randint(0, 256, [192, 256, 3]).astype(np.uint8)
image = np.expand_dims(image, axis=0)
tic = time.time()
result = compiled_model([image])[output_key]
toc = time.time()
print(toc - tic)

I can run it on the CPU successfully, but no NCS2.

Iffa-Intel commented 2 years ago

@LinBaoxin I can see similar behaviour from my end.

Conversion into FP16 IR

conversion

CPU infer (success)

cpu

NCS2 infer (failed)

NCS2

We'll further investigate this and get back to you asap.

hbalasu1 commented 2 years ago

Hi @LinBaoxin

Look like this is the bug since the issue happened on NCS2. I have escalated this issue to our development teams and will get back to you once I have the answer as soon as possible.

Regards, Hari Chand

Ref. 88871

lsprior commented 1 year ago

Hello, I too have exactly this problem. Can run the FP16 version on the CPU and GPU but not on myriad. Same output

RuntimeError: StatefulPartitionedCall/floordiv_3 of type Floor: [ GENERAL_ERROR ] C:\j\workspace\private-ci\ie\build-windows-vs2019@3\b\repos\openvino\src\plugins\intel_myriad\graph_transformer\src\model\stage.cpp:305 Stage node StatefulPartitionedCall/floordiv_3 (Floor) types check error: input #0 has type S32, but FP16 is expected

Any news on this issue?

Regards

hbalasu1 commented 1 year ago

Hi @lsprior

I received a reply from the Developer that Floor operation is only supported on Myriad for FP16. Such movenet model is not supported by the Myriad plugin. A possible workaround could be to include a convert operation in the model so that it works with the Myriad plugin.

Hope this information help

Thank you

avitial commented 1 year ago

Closing this. Feel free to reopen and ask any questions related to this topic.