首先pytorch模型要先转化为onxx模型,然后从onxx模型转化为rknn模型
直接转化会出现如下问题,环境都是正确的,论坛询问后也没给出准确答案说是版本问题
--> Loading model
./final.pt ********************
加载失败
E Catch exception when loading pytorch model: ./final.pt!
E Traceback (most recent call last):
E File "rknnapi
knn_base.py", line 339, in rknn.api.rknn_base.RKNNBase.load_pytorch
E File "rknnaseRKNNlibRK_nn.py", line 146, in rknn.base.RKNNlib.RK_nn.RKnn.load_pytorch
E File "rknnaseRKNNlibappimporterimport_pytorch.py", line 128, in rknn.base.RKNNlib.app.importer.import_pytorch.ImportPytorch.run
E File "rknnaseRKNNlibconverterconvert_pytorch_new.py", line 2250, in rknn.base.RKNNlib.converter.convert_pytorch_new.convert_pytorch.load
E File "rknnaseRKNNlibconverterconvert_pytorch_new.py", line 2055, in rknn.base.RKNNlib.converter.convert_pytorch_new.PyTorchOpConverter.report_missing_conversion
E NotImplementedError: The following operators are not implemented: ['aten::detach', 'aten::to', 'aten::floor']
Process finished with exit code 0
转化onxx模型具体如下将YoloV3模型的pytorch权重文件转化为onxx
然后使用图形化界面进行转化,只要安装了rknn模块就会有图形化界面