Hi,
I am also working on same thing deploying the YOLOPv2 model on to Metis M2. I have downloadded the data set from bdd100k and arranged in this manner.
voyager-sdk/
├── data/
│ └── yolopv2_dataset/
│ ├── images/
│ ├── labels/
│ ├── cal.txt
│ ├── val.txt
│ └── data.yaml
├── customers/
│ └── my_yolopv2/
│ └── yolopv2.pt
└── yolopv2-custom.yaml
so when i am trying to deploy the model using yaml I am getting this error
(venv) aravind@aravind-H610M-H-V2:~/Desktop/voyager-sdk$ ./deploy.py customers/my_yolopv2/yolopv2.yaml
INFO : Using device metis-0:1:0
INFO : Detected Metis type as pcie
INFO : Compiling network yolopv2-custom /home/aravind/Desktop/voyager-sdk/customers/my_yolopv2/yolopv2.yaml
INFO : Compile model: yolopv2-custom
INFO : Imported DataAdapter ObjDataAdaptor from /home/aravind/Desktop/voyager-sdk/ax_datasets/objdataadapter.py
/home/aravind/.cache/axelera/venvs/93f45ae3/lib/python3.10/site-packages/torch/serialization.py:779: UserWarning: 'torch.load' received a zip file that looks like a TorchScript archive dispatching to 'torch.jit.load' (call 'torch.jit.load' directly to silence this warning)
warnings.warn("'torch.load' received a zip file that looks like a TorchScript archive"
WARNING The file '/home/aravind/Desktop/voyager-sdk/customers/my_yolopv2/yolopv2_clean.pt' appears to be improperly saved or formatted. For optimal results, use model.save('filename.pt') to correctly save YOLO models.
ERROR : 'RecursiveScriptModule' object has no attribute 'model'
INFO : Compiling c-yolopv2-custom took 2.406 seconds
ERROR : Failed to deploy network
Can any one help me with this..
Here is my YAML script for your reference
axelera-model-format: 1.0.0
name: yolopv2-custom
description: "YOLOPv2 pretrained model deployed for lane detection using custom dataset"
pipeline:
- yolopv2-custom:
model_name: yolopv2-custom
template_path: $AXELERA_FRAMEWORK/pipeline-template/yolo-letterbox.yaml
postprocess:
- decodeyolo:
max_nms_boxes: 30000
conf_threshold: 0.25
nms_iou_threshold: 0.45
nms_class_agnostic: false
nms_top_k: 300
models:
yolopv2-custom:
class: AxUltralyticsYOLO
class_path: $AXELERA_FRAMEWORK/ax_models/yolo/ax_ultralytics.py
weight_path: $AXELERA_FRAMEWORK/customers/my_yolopv2/yolopv2_clean.pt
task_category: ObjectDetection
input_tensor_layout: NCHW
input_tensor_shape: p1, 3, 640, 640]
input_color_format: RGB
num_classes: 10
dataset: yolopv2-dataset
datasets:
yolopv2-dataset:
class: ObjDataAdaptor
class_path: $AXELERA_FRAMEWORK/ax_datasets/objdataadapter.py
data_dir_name: yolopv2_dataset
repr_imgs_dir_path: $AXELERA_FRAMEWORK/data/yolopv2_dataset/images
label_type: YOLOv8
labels: data.yaml
cal_data: cal.txt
val_data: val.txt
#model-env:
# dependencies:
# - torch
# - ultralytics