smartlab demo not working with OV 2022.1
I'm getting the following error when trying to run smartlab demo. The latest 2022.1 OV runtime is installed. Any ideas how i can fix this ?
Traceback (most recent call last):
File "smartlab_demo.py", line 144, in
Python command to launch the demo:
python smartlab_demo.py
-tv .\stream_1_top.mp4
-fv .\stream_1_high.mp4
-m_ta ".\intel\smartlab-object-detection-0001\FP32\smartlab-object-detection-0001.xml"
-m_tm ".\intel\smartlab-object-detection-0002\FP32\smartlab-object-detection-0002.xml"
-m_fa ".\intel\smartlab-object-detection-0003\FP32\smartlab-object-detection-0003.xml"
-m_fm ".\intel\smartlab-object-detection-0004\FP32\smartlab-object-detection-0004.xml"
-m_en ".\public\i3d-rgb-tf\FP32\i3d-rgb-tf.xml"
-m_de ".\intel\smartlab-sequence-modelling-0001/FP32/smartlab-sequence-modelling-0001.xml"
do note that openvino-dev 2022.1 is installed on the machine, and omz_downloader and omz_converter is used to download & convert the models.
@kminemur, can you look at it?
@wallacezq
probably the error comes from reshape (line 57-58), since openvino API2.0, the model shape changed.
You may try
net.reshape({net.inputs[0]: PartialShape( [self.EmbedBatchSize, 3, self.EmbedWindowLength, self.ImgSizeHeight, self.ImgSizeWidth])})
@kminemur it doesn't work.
I get the following error:
C:\test\open_model_zoo_2022\2022.1.0\open_model_zoo\demos\smartlab_demo\python>start.bat
Traceback (most recent call last):
File "smartlab_demo.py", line 144, in
the models come from which openvino version? 2022.1?
@kminemur downloaded with omz_downloader of the openvino-dev==2022.1.0
I reproduced your issue. will take a look
Hi i3d-rgb-tf model was changed, so need to fix some part of codes.
Workaround: please change segmentor.py as following
[L56-61]
net = core.read_model(i3d_path)
net.reshape({net.inputs[0]: PartialShape(
[self.EmbedBatchSize, self.EmbedWindowLength, self.ImgSizeHeight, self.ImgSizeWidth, 3])})
nodes = net.get_ops() net.add_outputs(nodes[11].output(0))
[L128-129] ~~input_data = np.asarray(input_data).transpose((0, 4, 1, 2, 3))~~ input_data = np.asarray(input_data) * 127.5 + 127.5
[L181-185] predictions = predictions[:, np.newaxis, :len(self.ActionTerms), :]
temporal_logits = predictions[:, :, :len(self.ActionTerms), :] # 11x16x2048 temporal_logits = softmax(temporal_logits[-1], 1) # 16x2048 temporal_logits = temporal_logits.transpose((0, 2, 1)).squeeze(axis=0)
Thanks for the workaround @kminemur . It only works for me if i added a minor change to the workaround proposed by you, else i would get an error that says TypeError: can't multiply sequence by non-int of type 'float'
@L128
- input_data = np.asarray(input_data).transpose(0,4,1,2,3))
+ input_data = np.asarray(input_data)
Thanks for the comment will create patch
patch created https://github.com/openvinotoolkit/open_model_zoo/pull/3430
@wallacezq patch #3430 merged to master branch, please verify