openvinotoolkit / openvino

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

[Bug] Unsupported dynamic ops #6388

Closed hz658832 closed 3 years ago

hz658832 commented 3 years ago
System information (version)
Detailed description

Hello, I have converted a onnx model to openvino sucessfully, but while inference, I got the following error: Traceback (most recent call last): File "openvino_inference.py", line 17, in exec_net = ie.load_network(net, 'CPU') File "ie_api.pyx", line 336, in openvino.inference_engine.ie_api.IECore.load_network File "ie_api.pyx", line 345, in openvino.inference_engine.ie_api.IECore.load_network RuntimeError: Unsupported dynamic ops: v3::NonZero NonZero_214 (Equal_212[0]:u8{619}) -> (i32{1,[0, 619]}) v1::Reshape Transpose_215 (NonZero_214[0]:i32{1,[0, 619]}, Constant_3115[0]:i32{2}) -> (i32{[0, 619],1}) v5::GatherND GatherND_216 (Pad_17[0]:i32{619,4}, Transpose_215[0]:i32{[0, 619],1}) -> (i32{[0, 619],4}) v0::GatherIE GatherIE_7013 (GatherND_216[0]:i32{[0, 619],4}, Unsqueeze_7012[0]:i32{1}) -> (i32{[0, 619],1}) v0::Squeeze Gather_2181218 (GatherIE_7013[0]:i32{[0, 619],1}, Constant_7016[0]:i32{1}) -> (i32{[0, 619]}) v1::Eltwise Mul_220 (Gather_2181218[0]:i32{[0, 619]}, Constant_219/EltwiseUnsqueeze8563_const[0]:i32{1}) -> (i32{?}) v0::GatherIE GatherIE_7020 (GatherND_216[0]:i32{[0, 619],4}, Unsqueeze_7019[0]:i32{1}) -> (i32{[0, 619],1}) v0::Squeeze Gather_2221198 (GatherIE_7020[0]:i32{[0, 619],1}, Constant_7023[0]:i32{1}) -> (i32{[0, 619]}) v1::Eltwise Add_223 (Mul_220[0]:i32{?}, Gather_2221198[0]:i32{[0, 619]}) -> (i32{?}) v1::Reshape Reshape_241 (Add_223[0]:i32{?}, Reshape_241/Cast_117154_const[0]:i32{1}) -> (i32{?}) v1::Broadcast Expand_258 (Reshape_241[0]:i32{?}, Constant_3676[0]:i32{2}, Constant_3677[0]:u8{}) -> (i32{64,619}) v3::NonZero NonZero_226 (Equal_212[0]:u8{619}) -> (i32{1,[0, 619]}) v1::Reshape Transpose_227 (NonZero_226[0]:i32{1,[0, 619]}, Constant_3143[0]:i32{2}) -> (i32{[0, 619],1}) v5::GatherND GatherND_228 (Squeeze_205[0]:f32{619,64}, Transpose_227[0]:i32{[0, 619],1}) -> (f32{[0, 619],64}) v1::Transpose Transpose_229 (GatherND_228[0]:f32{[0, 619],64}, Transpose_229/Cast_117098_const[0]:i32{2}) -> (f32{64,[0, 619]}) v3::ScatterNDUpdate ScatterND_268 (ConstantOfShape_207/Broadcast/Output_0/Dataconst[0]:f32{64,140800}, Concat_260[0]:i32{64,619,2}, Transpose_229[0]:f32{64,[0, 619]}) -> (f32{64,140800}) v3::NonZero NonZero_434 (anchors_mask[0]:u8{281600}) -> (i32{1,[0, 281600]}) v1::Reshape Transpose_435 (NonZero_434[0]:i32{1,[0, 281600]}, Constant_3167[0]:i32{2}) -> (i32{[0, 281600],1}) v5::GatherND GatherND_436 (Squeeze_424[0]:f32{281600,4}, Transpose_435[0]:i32{[0, 281600],1}) -> (f32{[0, 281600],4}) v0::Sigmoid Sigmoid_442 (GatherND_436[0]:f32{[0, 281600],4}) -> (f32{[0, 281600],4}) v1::TopKIE TopK_3829 (Sigmoid_442[0]:f32{[0, 281600],4}, Constant_7087[0]:i32{1}) -> (f32{[0, 281600],1}, i32{[0, 281600],1}) v0::Convert 7072.0 (TopK_3829[0]:f32{[0, 281600],1}) -> (f32{[0, 281600],1}) v0::Result 7072/sink_port_0 (7072.0[0]:f32{[0, 281600],1}) -> (f32{[0, 281600],1}) v3::NonZero NonZero_430 (anchors_mask[0]:u8{281600}) -> (i32{1,[0, 281600]}) v1::Reshape Transpose_431 (NonZero_430[0]:i32{1,[0, 281600]}, Constant_3183[0]:i32{2}) -> (i32{[0, 281600],1}) v5::GatherND GatherND_432 (Squeeze_422[0]:f32{281600,5}, Transpose_431[0]:i32{[0, 281600],1}) -> (f32{[0, 281600],5}) v1::ReduceMax ReduceMax_443 (Sigmoid_442[0]:f32{[0, 281600],4}, ReduceMax_443/Cast_117128_const[0]:i32{1}) -> (f32{[0, 281600]}) v1::Greater Greater_446 (ReduceMax_443[0]:f32{[0, 281600]}, Constant_445/EltwiseUnsqueeze8575_const[0]:f32{1}) -> (u8{[0, 281600]}) v3::NonZero NonZero_448 (Greater_446[0]:u8{[0, 281600]}) -> (i32{1,?}) v1::Reshape Transpose_449 (NonZero_448[0]:i32{1,?}, Constant_3187[0]:i32{2}) -> (i32{?,1}) v5::GatherND GatherND_450 (GatherND_432[0]:f32{[0, 281600],5}, Transpose_449[0]:i32{?,1}) -> (f32{?,5}) v0::GatherIE GatherIE_7109 (GatherND_450[0]:f32{?,5}, Unsqueeze_7108[0]:i32{1}) -> (f32{?,1}) v0::Squeeze Gather_4601200 (GatherIE_7109[0]:f32{?,1}, Constant_7112[0]:i32{1}) -> (f32{?}) v1::Greater Greater_462 (Gather_4601200[0]:f32{?}, Constant_461/EltwiseUnsqueeze8579_const[0]:f32{1}) -> (u8{?}) v3::NonZero NonZero_438 (anchors_mask[0]:u8{281600}) -> (i32{1,[0, 281600]}) v1::Reshape Transpose_439 (NonZero_438[0]:i32{1,[0, 281600]}, Constant_3195[0]:i32{2}) -> (i32{[0, 281600],1}) v5::GatherND GatherND_440 (Squeeze_426[0]:f32{281600,2}, Transpose_439[0]:i32{[0, 281600],1}) -> (f32{[0, 281600],2}) v1::TopKIE TopK_3834 (GatherND_440[0]:f32{[0, 281600],2}, Constant_7114[0]:i32{1}) -> (f32{[0, 281600],1}, i32{[0, 281600],1}) v0::Convert 7068.1 (TopK_3834[1]:i32{[0, 281600],1}) -> (i32{[0, 281600],1}) v1::Reshape ArgMax_441/Squeeze (7068.1[0]:i32{[0, 281600],1}, Constant_3199[0]:i32{1}) -> (i32{[0, 281600]}) v3::NonZero NonZero_456 (Greater_446[0]:u8{[0, 281600]}) -> (i32{1,?}) v1::Reshape Transpose_457 (NonZero_456[0]:i32{1,?}, Constant_3203[0]:i32{2}) -> (i32{?,1}) v5::GatherND GatherND_458 (ArgMax_441/Squeeze[0]:i32{[0, 281600]}, Transpose_457[0]:i32{?,1}) -> (i32{?}) v0::Convert Cast_463 (GatherND_458[0]:i32{?}) -> (u8{?}) v1::LogicalXor Xor_466 (Greater_462[0]:u8{?}, Cast_463[0]:u8{?}) -> (u8{?}) v1::Select Where_470 (Xor_466[0]:u8{?}, Constant_468/Output_0/Dataconst[0]:i32{}, Constant_469/Output_0/Dataconst[0]:i32{}) -> (i32{?}) v0::Convert Cast_471 (Where_470[0]:i32{?}) -> (f32{?}) v1::PowerIE Mul_473 (Cast_471[0]:f32{?}) -> (f32{?}) v1::Broadcast Expand_487 (Mul_473[0]:f32{?}, Constant_3691[0]:i32{1}, Constant_3692[0]:u8{}) -> (f32{281600}) v1::Eltwise Add_524 (GatherND_450[0]:f32{?,5}, ScatterND_523[0]:f32{281600,5}) -> (f32{?,5}) v1::VariadicSplit Split_531/VariadicSplit (Add_524[0]:f32{?,5}, Split_531/VariadicSplit_input_port_1/value/Output_0/Dataconst[0]:i32{}, Split_531/VariadicSplit_input_port_2/value/Output_0/Dataconst[0]:i32{5}) -> (f32{?,1}, f32{?,1}, f32{?,1}, f32{?,1}, f32{?,1}) v1::Eltwise Mul_573 (1192/Output_0/Dataconst[0]:f32{1,4}, Split_531/VariadicSplit[3]:f32{?,1}) -> (f32{?,4}) v1::Reshape Unsqueeze_574/Unsqueeze (Mul_573[0]:f32{?,4}, Constant_3207[0]:i32{3}) -> (f32{281600,4,1}) v1::Reshape Reshape_559 (Split_531/VariadicSplit[4]:f32{?,1}, Reshape_559/Cast_117144_const[0]:i32{3}) -> (f32{?,1,1}) v1::TileIE Expand_570: (Reshape_559[0]:f32{?,1,1}) -> (f32{?,1,7}) v1::TileIE Expand_570 (Expand_570:[0]:f32{?,1,7}) -> (f32{?,4,7}) v0::Cos Cos_571 (Expand_570[0]:f32{?,4,7}) -> (f32{?,4,7}) v1::Eltwise Mul_599 (Unsqueeze_574/Unsqueeze[0]:f32{281600,4,1}, Cos_571[0]:f32{?,4,7}) -> (f32{?,4,7}) v1::Eltwise Mul_586 (1193/Output_0/Data__const[0]:f32{1,7}, Split_531/VariadicSplit[2]:f32{?,1}) -> (f32{?,7}) v1::Reshape Unsqueeze_587/Unsqueeze (Mul_586[0]:f32{?,7}, Constant_3211[0]:i32{3}) -> (f32{281600,1,7}) v0::Sin Sin_572 (Expand_570[0]:f32{?,4,7}) -> (f32{?,4,7}) v1::Eltwise Mul_600 (Unsqueeze_587/Unsqueeze[0]:f32{281600,1,7}, Sin_572[0]:f32{?,4,7}) -> (f32{?,4,7}) v1::Eltwise Add_601 (Mul_599[0]:f32{?,4,7}, Mul_600[0]:f32{?,4,7}) -> (f32{?,4,7}) v1::Reshape Reshape_533 (Split_531/VariadicSplit[0]:f32{?,1}, Reshape_533/Cast_117206_const[0]:i32{3}) -> (f32{?,1,1}) v1::Eltwise Add_602 (Add_601[0]:f32{?,4,7}, Reshape_533[0]:f32{?,1,1}) -> (f32{?,4,7}) v1::Transpose Transpose_607 (Add_602[0]:f32{?,4,7}, Transpose_607/Cast_117168_const[0]:i32{3}) -> (f32{4,7,?}) v1::PowerIE Mul_611/FusedMul (Transpose_607[0]:f32{4,7,?}) -> (f32{4,7,?}) v1::Reshape Unsqueeze_631/Unsqueeze (Mul_611/FusedMul[0]:f32{4,7,?}, Constant_3219[0]:i32{4}) -> (f32{28,281600,1,1}) v1::Eltwise Mul_603 (Unsqueeze_587/Unsqueeze[0]:f32{281600,1,7}, Cos_571[0]:f32{?,4,7}) -> (f32{?,4,7}) v1::Eltwise Mul_604 (Unsqueeze_574/Unsqueeze[0]:f32{281600,4,1}, Sin_572[0]:f32{?,4,7}) -> (f32{?,4,7}) v1::PowerIE Multiply_3422 (Mul_604[0]:f32{?,4,7}) -> (f32{?,4,7}) v1::Eltwise Sub_605/sub (Mul_603[0]:f32{?,4,7}, Multiply_3422[0]:f32{?,4,7}) -> (f32{?,4,7}) v1::Reshape Reshape_546 (Split_531/VariadicSplit[1]:f32{?,1}, Reshape_546/Cast_117164_const[0]:i32{3}) -> (f32{?,1,1}) v1::Eltwise Add_606 (Sub_605/sub[0]:f32{?,4,7}, Reshape_546[0]:f32{?,1,1}) -> (f32{?,4,7}) v1::Transpose Transpose_612 (Add_606[0]:f32{?,4,7}, Transpose_612/Cast_117204_const[0]:i32{3}) -> (f32{4,7,?}) v1::PowerIE Add_614/FusedAdd (Transpose_612[0]:f32{4,7,?}) -> (f32{4,7,?}) v1::Reshape Unsqueeze_633/Unsqueeze (Add_614/FusedAdd[0]:f32{4,7,?}, Constant_3227[0]:i32{4}) -> (f32{28,281600,1,1}) v1::Reshape det_bboxes (Add_524[0]:f32{?,5}, det_bboxes/Cast_117094_const[0]:i32{2}) -> (f32{?,5}) v0::Result det_bboxes/sink_port_0 (det_bboxes[0]:f32{?,5}) -> (f32{?,5}) v0::Convert 7072.1 (TopK_3829[1]:i32{[0, 281600],1}) -> (i32{[0, 281600],1}) v1::Reshape ArgMax_444/Squeeze (7072.1[0]:i32{[0, 281600],1}, Constant_3231[0]:i32{1}) -> (i32{[0, 281600]}) v3::NonZero NonZero_452 (Greater_446[0]:u8{[0, 281600]}) -> (i32{1,?}) v1::Reshape Transpose_453 (NonZero_452[0]:i32{1,?}, Constant_3235[0]:i32{2}) -> (i32{?,1}) v5::GatherND det_labels (ArgMax_444/Squeeze[0]:i32{[0, 281600]}, Transpose_453[0]:i32{?,1}) -> (i32{?}) v0::Result det_labels/sink_port_0 (det_labels[0]:i32{?}) -> (i32{?}) v0::Convert 7068.0 (TopK_3834[0]:f32{[0, 281600],1}) -> (f32{[0, 281600],1}) v0::Result 7068/sink_port_0 (7068.0[0]:f32{[0, 281600],1}) -> (f32{[0, 281600],1})

Steps to reproduce

files

Issue submission checklist
Iffa-Intel commented 3 years ago

Hi,

If possible can you share your model files?

hz658832 commented 3 years ago

Hi Iffa, @Iffa-Meah

all the files are in "files", can you try to download them?

Thank you so much!

Bests,

haoming

Iffa-Intel commented 3 years ago

Hi,

Thank you for being patient. I had tested your model and I get the same issue as yours.

The biggest possibility is your model's topology is not supported. You may refer here for the list of supported ONNX model topology

if yours is not listed there, then it is not supported.

test