Hi @brian14
I have modified the Modified the common.py (https://github.com/ultralytics/yolov5/blob/master/models/common.py#L457) as follows:
'Linux': '/usr/lib/libvx_delegate.so' instead of 'Linux': 'libedgetpu.so.1',
Run the val.py script with the opensource yolov5s.tflite model(renamed as yolov5s-int8_edgetpu.tflite).
$ python3 val.py --weights yolov5s-int8_edgetpu.tflite --data data/coco128.yaml --img 640
it is observed that some logs related to VX delegate are printed, but the mAP value is Zero.
root@imx8mpevk:~/benchmark/yolov5# python3 val.py --weights yolov5s-int8_edgetpu.tflite --data data/coco128.yaml --img 640
/usr/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension:
warn(f"Failed to load image Python extension: {e}")
val: data=data/coco128.yaml, weights=['yolov5s-int8_edgetpu.tflite'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.6, max_det=300, task=val, device=, workers=8, single_cls=
False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=False, project=runs/val, name=exp, exist_ok=False, half=False, dnn=False
YOLOv5 <li-emoji id="lia_rocket" src="" class="lia-unicode-emoji" title=":rocket:"></li-emoji> v7.0-23-g5dc1ce4 Python-3.10.6 torch-1.11.0 CPU
Loading yolov5s-int8_edgetpu.tflite for TensorFlow Lite Edge TPU inference...
Vx delegate: allowed_cache_mode set to 0.
Vx delegate: device num set to 0.
Vx delegate: allowed_builtin_code set to 0.
Vx delegate: error_during_init set to 0.
Vx delegate: error_during_prepare set to 0.
Vx delegate: error_during_invoke set to 0.
Forcing --batch-size 1 square inference (1,3,640,640) for non-PyTorch models
val: Scanning /home/root/benchmark/datasets/coco128/labels/train2017.cache... 126 images, 2 backgrounds, 0 corrupt: 100%|██████████| 128/128 [00:00<?, ?it/s]
Class Images Instances P R mAP50 mAP50-95: 0%| | 0/128 [00:00<?, ?it/s]W [HandleLayoutInfer:278]Op 162: default layout infere
nce pass.
W [HandleLayoutInfer:278]Op 162: default layout inference pass.
W [HandleLayoutInfer:278]Op 162: default layout inference pass.
W [HandleLayoutInfer:278]Op 162: default layout inference pass.
W [HandleLayoutInfer:278]Op 162: default layout inference pass.
W [HandleLayoutInfer:278]Op 162: default layout inference pass.
Class Images Instances P R mAP50 mAP50-95: 16%|█▋ | 21/128 [00:27<00:28, 3.71it/s]WARNING <li-emoji id="lia_warning" src="" class="lia-unicode-emoji" title=":warning:"></li-emoji> NMS time limit 0.550s exce
eded
Class Images Instances P R mAP50 mAP50-95: 18%|█▊ | 23/128 [00:28<00:57, 1.84it/s]WARNING <li-emoji id="lia_warning" src="" class="lia-unicode-emoji" title=":warning:"></li-emoji> NMS time limit 0.550s exce
eded
Class Images Instances P R mAP50 mAP50-95: 26%|██▌ | 33/128 [00:32<00:24, 3.93it/s]WARNING <li-emoji id="lia_warning" src="" class="lia-unicode-emoji" title=":warning:"></li-emoji> NMS time limit 0.550s ex
ceeded
Class Images Instances P R mAP50 mAP50-95: 29%|██▉ | 37/128 [00:34<00:32, 2.79it/s]WARNING <li-emoji id="lia_warning" src="" class="lia-unicode-emoji" title=":warning:"></li-emoji> NMS time limit 0.550s ex
ceeded
Class Images Instances P R mAP50 mAP50-95: 34%|███▎ | 43/128 [00:38<00:33, 2.53it/s]WARNING <li-emoji id="lia_warning" src="" class="lia-unicode-emoji" title=":warning:"></li-emoji> NMS time limit 0.550s
exceeded
Class Images Instances P R mAP50 mAP50-95: 37%|███▋ | 47/128 [00:39<00:27, 2.96it/s]WARNING <li-emoji id="lia_warning" src="" class="lia-unicode-emoji" title=":warning:"></li-emoji> NMS time limit 0.550s
exceeded
Class Images Instances P R mAP50 mAP50-95: 41%|████ | 52/128 [00:42<00:28, 2.64it/s]WARNING <li-emoji id="lia_warning" src="" class="lia-unicode-emoji" title=":warning:"></li-emoji> NMS time limit 0.550s
exceeded
Class Images Instances P R mAP50 mAP50-95: 80%|███████▉ | 102/128 [00:57<00:09, 2.74it/s]WARNING <li-emoji id="lia_warning" src="" class="lia-unicode-emoji" title=":warning:"></li-emoji> NMS time limi
t 0.550s exceeded
Class Images Instances P R mAP50 mAP50-95: 100%|██████████| 128/128 [01:04<00:00, 1.98it/s]
all 128 929 0 0 0 0
Speed: 4.2ms pre-process, 344.9ms inference, 135.9ms NMS per image at shape (1, 3, 640, 640)
Here the inference time is 344 ms and mAP value is zero for all classes.
What could be the possible reason for this?