airockchip / rknn_model_zoo

Apache License 2.0
1.05k stars 192 forks source link

yolo_world_v2s.onnx转换错误,缺少文件coco_text_outp.npy #169

Closed yyyylm closed 2 months ago

yyyylm commented 2 months ago

python convert.py ../../model/yolo_world_v2s.onnx rk3568

I rknn-toolkit2 version: 2.1.0+708089d1 --> Config model done --> Loading model W load_onnx: If you don't need to crop the model, don't set 'inputs'/'input_size_list'/'outputs'! I Loading : 100%|███████████████████████████████████████████████| 152/152 [00:00<00:00, 6425.85it/s] W load_onnx: The config.mean_values is None, zeros will be set for input 1! W load_onnx: The config.std_values is None, ones will be set for input 1! done --> Building model I OpFusing 0: 100%|██████████████████████████████████████████████| 100/100 [00:00<00:00, 363.79it/s] I OpFusing 1 : 100%|█████████████████████████████████████████████| 100/100 [00:00<00:00, 171.27it/s] I OpFusing 0 : 100%|██████████████████████████████████████████████| 100/100 [00:01<00:00, 86.71it/s] I OpFusing 1 : 100%|██████████████████████████████████████████████| 100/100 [00:01<00:00, 83.27it/s] I OpFusing 2 : 100%|██████████████████████████████████████████████| 100/100 [00:01<00:00, 79.76it/s] I OpFusing 0 : 100%|██████████████████████████████████████████████| 100/100 [00:01<00:00, 68.22it/s] I OpFusing 1 : 100%|██████████████████████████████████████████████| 100/100 [00:01<00:00, 66.17it/s] I OpFusing 2 : 100%|██████████████████████████████████████████████| 100/100 [00:02<00:00, 39.42it/s] E build: Traceback (most recent call last): File "rknn/api/rknn_log.py", line 309, in rknn.api.rknn_log.error_catch_decorator.error_catch_wrapper File "rknn/api/rknn_base.py", line 1910, in rknn.api.rknn_base.RKNNBase.build File "rknn/api/graph_optimizer.py", line 2295, in rknn.api.graph_optimizer.GraphOptimizer.sparse_weight File "rknn/api/sparse_weight.py", line 528, in rknn.api.sparse_weight.sparse_weight File "rknn/api/sparse_weight.py", line 72, in rknn.api.sparse_weight._range_input File "/usr/local/lib/python3.8/dist-packages/numpy/lib/npyio.py", line 405, in load fid = stack.enter_context(open(os_fspath(file), "rb")) FileNotFoundError: [Errno 2] No such file or directory: '/rknn_work/rknn_model_zoo/examples/yolo_world/model/coco_text_outp.npy'

W build: ===================== WARN(3) ===================== E rknn-toolkit2 version: 2.1.0+708089d1 Traceback (most recent call last): File "rknn/api/rknn_log.py", line 309, in rknn.api.rknn_log.error_catch_decorator.error_catch_wrapper File "rknn/api/rknn_base.py", line 1910, in rknn.api.rknn_base.RKNNBase.build File "rknn/api/graph_optimizer.py", line 2295, in rknn.api.graph_optimizer.GraphOptimizer.sparse_weight File "rknn/api/sparse_weight.py", line 528, in rknn.api.sparse_weight.sparse_weight File "rknn/api/sparse_weight.py", line 72, in rknn.api.sparse_weight._range_input File "/usr/local/lib/python3.8/dist-packages/numpy/lib/npyio.py", line 405, in load fid = stack.enter_context(open(os_fspath(file), "rb")) FileNotFoundError: [Errno 2] No such file or directory: '/rknn_work/rknn_model_zoo/examples/yolo_world/model/coco_text_outp.npy'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "convert.py", line 74, in ret = rknn.build(do_quantization=do_quant, dataset=DATASET) File "/usr/local/lib/python3.8/dist-packages/rknn/api/rknn.py", line 192, in build return self.rknn_base.build(do_quantization=do_quantization, dataset=dataset, expand_batch_size=rknn_batch_size) File "rknn/api/rknn_log.py", line 314, in rknn.api.rknn_log.error_catch_decorator.error_catch_wrapper File "rknn/api/rknn_log.py", line 95, in rknn.api.rknn_log.RKNNLog.e ValueError: Traceback (most recent call last): File "rknn/api/rknn_log.py", line 309, in rknn.api.rknn_log.error_catch_decorator.error_catch_wrapper File "rknn/api/rknn_base.py", line 1910, in rknn.api.rknn_base.RKNNBase.build File "rknn/api/graph_optimizer.py", line 2295, in rknn.api.graph_optimizer.GraphOptimizer.sparse_weight File "rknn/api/sparse_weight.py", line 528, in rknn.api.sparse_weight.sparse_weight File "rknn/api/sparse_weight.py", line 72, in rknn.api.sparse_weight._range_input File "/usr/local/lib/python3.8/dist-packages/numpy/lib/npyio.py", line 405, in load fid = stack.enter_context(open(os_fspath(file), "rb")) FileNotFoundError: [Errno 2] No such file or directory: '/rknn_work/rknn_model_zoo/examples/yolo_world/model/coco_text_outp.npy'

scangit commented 2 months ago

可以先按这种方式保存一下,后续会上传。

def run(self):
        text_outputs = self.clip_text_run()

        text_outputs = np.expand_dims(text_outputs, axis=0)
        if args.save_text_outputs:
            np.save('../model/coco_text_outp.npy', text_outputs)
            print('save text outputs success')
zlm646 commented 2 months ago

可是没有rknn模型怎么run呢

airockchip commented 2 months ago

参考:https://github.com/airockchip/rknn_model_zoo/blob/main/examples/yolo_world/model/coco_text_outp.npy