|
模型转换代码
- from rknn.api import RKNN
- INPUT_SIZE = 64
- if __name__ == '__main__':
- # Create RKNN object
- rknn = RKNN()
- # init runtime environment
- print('--> Init runtime environment')
- ret = rknn.init_runtime()
- if ret != 0:
- print('Init runtime environment failed')
- exit(ret)
- print('done')
- # Config for Model Input PreProcess
- rknn.config(channel_mean_value='127.5 127.5 127.5 128', reorder_channel='0 1 2')
- #rknn.config(channel_mean_value='0 0 0 255', reorder_channel='2 1 0')
- # Load TensorFlow Model
- print('--> Loading model')
- rknn.load_caffe(model='./model/det1.prototxt',
- proto='caffe',
- blobs='./model/det1.caffemodel')
- print('done')
- # Build Model
- print('--> Building model')
- rknn.build(do_quantization=False, pre_compile = True, dataset='./dataset.txt')
- print('done')
- # Export RKNN Model
- rknn.export_rknn('./model/det1.rknn')
- # Release RKNN Context
- rknn.release()
错误日志
- [toybrick@localhost Mtcnn]$ python3 rknn_transfer.py
- /usr/lib64/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
- from ._conv import register_converters as _register_converters
- --> Init runtime environment
- done
- --> Loading model
- done
- --> Building model
- E Catch exception when building RKNN model!
- T Traceback (most recent call last):
- T File "rknn/api/rknn_base.py", line 487, in rknn.api.rknn_base.RKNNBase.build
- T File "rknn/api/rknn_base.py", line 416, in rknn.api.rknn_base.RKNNBase._build
- T File "rknn/base/ovxconfiggenerator.py", line 146, in rknn.base.ovxconfiggenerator.generate_vx_config_from_files
- T File "rknn/base/rknnlib/app/helper/striphelper.py", line 101, in rknn.base.rknnlib.app.helper.striphelper.StripHelper.build_network_2
- T File "rknn/base/rknnlib/app/helper/striphelper.py", line 447, in rknn.base.rknnlib.app.helper.striphelper.StripHelper._pack_data
- T File "rknn/base/rknnlib/app/helper/vdata_generator.py", line 98, in rknn.base.rknnlib.app.helper.vdata_generator.VDataGenerator.__init__
- T File "rknn/base/rknnlib/app/helper/vdata_generator.py", line 245, in rknn.base.rknnlib.app.helper.vdata_generator.VDataGenerator._parse_ovx_vdata
- T FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp_ta3hlyl/PNet.vdata'
- done
模型文件详见附件
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|