|
1. cd ..../rknn-toolkit2-1.0.0_no_docker/examples/pytorch/resnet18
$ python3 test.py
没有问题
2. 修改了test.py
把模型修改成:
model = './best.pt'
3. $ python3 test.py
现在报如下错误:
--> config model
done
--> Loading model
Traceback (most recent call last):
File "test.py", line 66, in <module>
ret = rknn.load_pytorch(model=model, input_size_list=input_size_list)
File "/home/rknn2/.local/lib/python3.6/site-packages/rknn/api/rknn.py", line 175, in load_pytorch
ret = self.rknn_base.load_pytorch(model=model, input_size_list=input_size_list, inputs=inputs, outputs=outputs)
File "rknn/api/rknn_base.py", line 1882, in rknn.api.rknn_base.RKNNBase.load_pytorch
File "/home/rknn2/.local/lib/python3.6/site-packages/torch/jit/__init__.py", line 275, in load
cpp_module = torch._C.import_ir_module(cu, f, map_location, _extra_files)
RuntimeError: [enforce fail at inline_container.cc:209] . file not found: archive/constants.pkl
4. best.pt是从:yolov5目录训练完了拷贝出来的:
./runs/train/exp5/weights/best.pt
yolov5: https://github.com/airockchip/yolov5
|
|