Hi,
I have implemented a custom action recognition using this repo
GitHub - stoneMo/YOWOv2 (main branch), which uses yolo as the 2D backbone of the model.
I tested it in the jupyter notebook and it was working fine, after that, I exported the weight to a dynamic ONNX file using this code:
x = torch.randn((1, 3, 16, 224,224), requires_grad=True)
input_names = [“input0”]
output_names = [‘output0’]
onnx_file_name = “yowo_-1_3_{}_{}_dynamic.onnx”.format(224, 224)
dynamic_axes = {“input”: {0: “batch_size”}, “boxes”: {0: “batch_size”}, “confs”: {0: “batch_size”}}
torch.onnx.export(model,
x,
onnx_file_name,
export_params=True,
opset_version=11,
do_constant_folding=True,
input_names=input_names, output_names=output_names,
dynamic_axes=dynamic_axes)
I used the 3D action recognition sample app, I edit the config files and used the yolo parsing to handle the output layer, I also ensure that the output parsing is similar to the prediction process in the jupyter.
the dynamic ONNX model sucsessfully converted to engine but the problem is that:
in the yolo output layer in the parsing process there are 7 parameters calculated, 4 for bounding box, 2 for each class probabilty, and the 7th one is for the objectness.
the objectness can be negative but it also should be positive for some boxes which indicate the final bounding box detection,
but in my case, the objectness is always negative, I have changed many parameters (scaling factor, offset, color format) but it is always negative for all boxes, and it seems that the output layer values have changed.