|
如题,用的onnx的ssd模型 :https://github.com/onnx/models/tree/master/ssd,用的1.0的api,报错如下,
ssd模型参数如图:
代码如下:
import numpy as np
import cv2
from rknn.api import RKNN
if __name__ == '__main__':
# Create RKNN object
rknn = RKNN(verbose=True)
# pre-process config
print('--> config model')
rknn.config(channel_mean_value='103.94 116.78 123.68 58.82', reorder_channel='2 1 0')
print('done')
# Load onnx model
print('--> Loading model')
ret = rknn.load_onnx(model='./ssd.onnx')
if ret != 0:
print('Load mobilenet_v2 failed! Ret = {}'.format(ret))
exit(ret)
print('done')
# Build model
print('--> Building model')
ret = rknn.build(do_quantization=True, dataset='./dataset.txt')
if ret != 0:
print('Build ssd failed!')
exit(ret)
print('done')
# Export rknn model
print('--> Export RKNN model')
ret = rknn.export_rknn('./ssd.rknn')
if ret != 0:
print('Export ssd.rknn failed!')
exit(ret)
print('done')
rknn.release()
另外,之前我还发了转换出错的帖子,大佬们帮忙一起解决下,帖子地址:
http://t.rock-chips.com/forum.php?mod=viewthread&tid=420&highlight=onnx
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|