Description
Hi
I was trying to carry out inference from the pre-trained model following the ros2 deployment instructions. I was able to execute that successfully.
I want to enable the semantic segmentation output as well, so to enable that I followed below steps.
- Generated
.onnx
file using this command with--enable-semantic
flag.
python3 onnx_conversion.py -p <checkpoint> -o <onnx_file_path> --enable-semantic
and converted it to trt.engine file
- Then checked the dimensions for the segmentation mask using the output of ONNX file
for output in onnx_model.graph.output:
print(f"Output Name: {output.name}, Shape: {output.type.tensor_type.shape}")
-
After that modified the x_mobility_navigator.py file and made below modifications
a. Initialized the variable hereself.segmentation_output = np.zeros((1, 1, 7, 320, 512), dtype=np.float32)
b. Then in this function addedcuda.mem_alloc
,cuda.memcpy_htod
,cuda.memcpy_dtoh
for the same -
When I ran the inference I got the masks but the values are zero
- I am getting the right shape
(1, 1, 7, 320, 512)
- but all the values are zero
Segmentation Output: [[[[[0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] ...
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]]
[x_mobility_navigator-1]
[x_mobility_navigator-1] [[0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] ...
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]]
[x_mobility_navigator-1]
[x_mobility_navigator-1] [[0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] ...
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]]
[x_mobility_navigator-1]
[x_mobility_navigator-1] ...
[x_mobility_navigator-1]
[x_mobility_navigator-1] [[0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] ...
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]]
[x_mobility_navigator-1]
[x_mobility_navigator-1] [[0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] ...
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]]
[x_mobility_navigator-1]
[x_mobility_navigator-1] [[0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] ...
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]
[x_mobility_navigator-1] [0. 0. 0. ... 0. 0. 0.]]]]]
Any suggestions and swift response will be highly appreciated.
Thanks in advance, and anything to be kept in mind as I am planning on generating the dataset and train it for my use-case with 5 classes.