Hi,
I used the Faster-RCNN model to train the PyTorch model.
Conversion to onnx works fine and the model works, but I have dynamic_axes. And hailomz parse doesn’t want to work with this model.
I created a yaml file for fasterrcnn_resnet50_fpn, but I am not sure if the configurations are correct.
base:
- base/coco.yaml
network:
network_name: fasterrcnn_resnet50_fpn paths:
alls_script: fasterrcnn_resnet50_fpn.alls network_path: - models_files/ObjectDetection/Detection-COCO/fasterrcnn_resnet50_fpn/2024-03-05/fasterrcnn_resnet50_fpn.onnx
url: https://hailo-model-zoo.s3.eu-west-2.amazonaws.com/ObjectDetection/Detection-COCO/fasterrcnn_resnet50_fpn/2024-03-05/fasterrcnn_resnet50_fpn.zip
postprocessing:
device_pre_post_layers:
nms: true
hpp: true
parser:
nodes:
- input
- - boxes
- scores
- labels
info:
task: object detection
input_shape: 800x800x3
output_shape: 1x100x4, 1x100, 1x100
operations: 60G
parameters: 41.1M
framework: pytorch
training_data: coco train2017
validation_data: coco val2017
eval_metric: mAP
full_precision_result: 37.0
source: https://github.com/pytorch/vision
license_url: https://github.com/pytorch/vision/blob/main/LICENSE
license_name: BSD-3-Clause
And output of hailomz is this:
hailomz parse --yaml yaml_files/fasterrcnn_resnet50_fpn.yaml --ckpt fasterrcnn_static.onnx --hw-arch hailo8l --start-node-names input --end-node-names boxes labels scores
<Hailo Model Zoo INFO> Start run for network fasterrcnn_resnet50_fpn ...
<Hailo Model Zoo INFO> Initializing the runner...
[info] Translation started on ONNX model fasterrcnn_resnet50_fpn
[warning] Large model detected. The graph may contain either a large number of operators, or weight variables with a very large capacity.
[warning] Translation time may be a bit long, and some features may be disabled (e.g. model augmentation, retry simplified model, onnx runtime hailo model extraction, etc.).
[info] Restored ONNX model fasterrcnn_resnet50_fpn (completion time: 00:00:00.57)
[warning] ONNX shape inference failed: Unsupported dynamic shape([0, 3, 0, 0]) found on input node input. Please use net_input_shapes, see documentation for additional info.
Traceback (most recent call last):
File "/local/workspace/hailo_virtualenv/bin/hailomz", line 33, in <module>
sys.exit(load_entry_point('hailo-model-zoo', 'console_scripts', 'hailomz')())
File "/local/workspace/hailo_model_zoo/hailo_model_zoo/main.py", line 122, in main
run(args)
File "/local/workspace/hailo_model_zoo/hailo_model_zoo/main.py", line 111, in run
return handlers[args.command](args)
File "/local/workspace/hailo_model_zoo/hailo_model_zoo/main_driver.py", line 203, in parse
parse_model(runner, network_info, ckpt_path=args.ckpt_path, results_dir=args.results_dir, logger=logger)
File "/local/workspace/hailo_model_zoo/hailo_model_zoo/core/main_utils.py", line 124, in parse_model
raise Exception(f"Encountered error during parsing: {err}") from None
Exception: Encountered error during parsing: Could not parse the model due to dynamic shapes. Please try to parse the model again, using: --tensor-shapes,
e.g. hailomz parse --yaml yaml_files/fasterrcnn_resnet50_fpn.yaml --ckpt fasterrcnn_static.onnx --hw-arch hailo8l --start-node-names input --end-node-names boxes labels scores --tensor-shapes [0,3,224,224]