• Cannot get length of dynamic dimension

Hi there I'm trying to convert my optimized Openvino model to a blob format however when i use the online Blob converter i got this error about the dimensions.

I tried on the command line and i got a different error during the conversion. Same error when running the conversion with python. How can i use my AI camera if i cannot convert the file to a readable format?

    nikocreatina

    It seems that the shapes in your model are dynamic. Which OpenVINO version have you used? The input shapes need to be static, which you can do by providing --input_shape [1,3,224,224] flag (for example) to model optimizer when generating the XML and BIN.

    Hi Matija

    I will explain in more details by providing some pictures along the way. I'm creating a model with a dataset made of videos, I'm using videoframegenerator. The input shape is of 8 batches having 15 frame of size 224,224 based on 3 colours.

    This is my model:

    I train the model, when i save the model in .pb format using savemodel function for TF2 i got the following message.

    "WARNING:absl:Found untraced functions such as _jit_compiled_convolution_op, lstm_cell_layer_call_fn, lstm_cell_layer_call_and_return_conditional_losses, _jit_compiled_convolution_op, _jit_compiled_convolution_op while saving (showing 5 of 55). These functions will not be directly callable after loading."

    checking online some people said to discard it. I tried to work around on how to fix this however is still there. Despite this message my model still get saved in the folder having one .pd file with 2 more folders.

    I load the model folder to visualize my model and double checked my input on the first layer. Please see the picture below as reference.

    I converted the model into IR format using this version of Openvino as follow:

    Version of Model Optimizer is: 2023.0.2-11065-e662b1a3301-releases/2023/0

    I converted first without the input shape to see what i got when i visualize the model. See pic below.

    As you can see the shape is that one. So i went back and set the input shape as you said following what the input shape should be. I also place the -1 at the beginning which i understood to be related to a value which might not be static and could change.

    I converted the model and then i tried the online tool however i got the same error regarding the dynamic shape.

    Now I understand that the version of Openvino is not exactly the same as the one use for the online tool could be a compatibility issue? If yes, what shall i do?

    Do you think the problem lies on the way the model is saved?

    I hope this information's might be usefully in the troubleshooting this issue.

    UPDATE:

    I converted the model from the .h5 format i had to onnx. By doing that no errors occurred during the saving. I then took the onnx model directly to the online converter however i got the same error regarding the dynamic shape.

      12 days later

      nikocreatina

      Sorry I missed this. Please hit "Reply" so I get a notification. I see where the problem is. So your actual input should be 5 dimensional not 4 dimensional tensor. What input shape did you specify when calling the model converter? If you leave any of the dimensions as "dynamic" (not fixed shape), it will not work and will fail.

        6 days later

        Matija 15,224,224,3 because this was the input shape specified in the model with 15 Frame of pictures having 224,224 and 3 channel. I didn't specify the batch during the conversion. However that batch are 8 on my model.