【边缘设备】yolov5训练与rknn模型导出并在RK3588部署~4.导出模型(亲测有效)

时间:2025-01-30 08:53:39
(base) jxxx@desk:~/workspace/algo/yolov5_rknn$ bash onekey_bash/export_rknn.sh export: weights=runs/train/drp/weights/, img_size=[320], batch_size=1, device=cpu, include=['torchscript', 'onnx'], half=False, inplace=False, train=False, optimize=True, dynamic=False, simplify=True, opset=12 YOLOv5 ???? c5360f6 torch 2.0.0+cu117 CPU Fusing layers... Model Summary: 224 layers, 7053910 parameters, 0 gradients, 16.3 GFLOPs PyTorch: starting from runs/train/drp/weights/ (14.3 MB) TorchScript: starting export with torch 2.0.0+cu117... TorchScript: export success, saved as runs/train/drp/weights/ (28.3 MB) ONNX: starting export with onnx 1.13.1... ... ... I rknn buiding done done --> Export rknn model done --> Init runtime environment W init_runtime: Target is None, use simulator! done (0.3333333333333333, 0.3333333333333333) 0.0 70.0 --> Running model Analysing : 100%|███████████████████████████████████████████████| 161/161 [00:00<00:00, 5866.87it/s] Preparing : 100%|█████████████████████████████████████████████████| 161/161 [00:04<00:00, 39.76it/s] W inference: The dims of input(ndarray) shape (320, 320, 3) is wrong, expect dims is 4! Try expand dims to (1, 320, 320, 3)! W inference: The dims of input(ndarray) shape (320, 320, 3) is wrong, expect dims is 4! Try expand dims to (1, 320, 320, 3)! W inference: The dims of input(ndarray) shape (320, 320, 3) is wrong, expect dims is 4! Try expand dims to (1, 320, 320, 3)! W inference: The dims of input(ndarray) shape (320, 320, 3) is wrong, expect dims is 4! Try expand dims to (1, 320, 320, 3)! done class: person, score: 0.8913032412528992 box coordinate topleft: (159.54501259326935, 145.2426918745041), bottomright: (177.8633736371994, 186.3882895708084) class: person, score: 0.8837643265724182 box coordinate topleft: (82.14642906188965, 183.73637676239014), bottomright: (110.66749000549316, 226.49699115753174) class: person, score: 0.8643947243690491 box coordinate topleft: (146.98097324371338, 140.67060202360153), bottomright: (164.14344692230225, 166.86144143342972) class: person, score: 0.8264284729957581 box coordinate topleft: (110.99540531635284, 146.92019426822662), bottomright: (130.9836596250534, 177.2033714056015) class: person, score: 0.7860860824584961 box coordinate topleft: (146.88146114349365, 127.81136840581894), bottomright: (163.5996789932251, 148.1453576683998) class: person, score: 0.7520475387573242 box coordinate topleft: (170.8560609817505, 123.72485554218292), bottomright: (185.6856870651245, 143.04388225078583) class: person, score: 0.6209931373596191 box coordinate topleft: (108.76676034927368, 133.68206477165222), bottomright: (119.2998595237732, 156.40799260139465)