Toybrick

标题: pre_compile = True时,模型转换错误 [打印本页]

作者: 771488533    时间: 2019-3-8 11:23
标题: pre_compile = True时,模型转换错误
模型转换代码
  1. from rknn.api import RKNN

  2. INPUT_SIZE = 64

  3. if __name__ == '__main__':

  4.     # Create RKNN object
  5.     rknn = RKNN()

  6.     # init runtime environment
  7.     print('--> Init runtime environment')
  8.     ret = rknn.init_runtime()
  9.     if ret != 0:
  10.         print('Init runtime environment failed')
  11.         exit(ret)
  12.     print('done')

  13.     # Config for Model Input PreProcess
  14.     rknn.config(channel_mean_value='127.5 127.5 127.5 128', reorder_channel='0 1 2')
  15.     #rknn.config(channel_mean_value='0 0 0 255', reorder_channel='2 1 0')

  16.     # Load TensorFlow Model
  17.     print('--> Loading model')
  18.     rknn.load_caffe(model='./model/det1.prototxt',
  19.                       proto='caffe',
  20.                       blobs='./model/det1.caffemodel')
  21.     print('done')

  22.     # Build Model
  23.     print('--> Building model')
  24.     rknn.build(do_quantization=False, pre_compile = True, dataset='./dataset.txt')
  25.     print('done')

  26.     # Export RKNN Model
  27.     rknn.export_rknn('./model/det1.rknn')

  28.     # Release RKNN Context
  29.     rknn.release()
复制代码
错误日志
  1. [toybrick@localhost Mtcnn]$ python3 rknn_transfer.py
  2. /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`.
  3.   from ._conv import register_converters as _register_converters
  4. --> Init runtime environment
  5. done
  6. --> Loading model
  7. done
  8. --> Building model
  9. E Catch exception when building RKNN model!
  10. T Traceback (most recent call last):
  11. T   File "rknn/api/rknn_base.py", line 487, in rknn.api.rknn_base.RKNNBase.build
  12. T   File "rknn/api/rknn_base.py", line 416, in rknn.api.rknn_base.RKNNBase._build
  13. T   File "rknn/base/ovxconfiggenerator.py", line 146, in rknn.base.ovxconfiggenerator.generate_vx_config_from_files
  14. T   File "rknn/base/rknnlib/app/helper/striphelper.py", line 101, in rknn.base.rknnlib.app.helper.striphelper.StripHelper.build_network_2
  15. T   File "rknn/base/rknnlib/app/helper/striphelper.py", line 447, in rknn.base.rknnlib.app.helper.striphelper.StripHelper._pack_data
  16. T   File "rknn/base/rknnlib/app/helper/vdata_generator.py", line 98, in rknn.base.rknnlib.app.helper.vdata_generator.VDataGenerator.__init__
  17. T   File "rknn/base/rknnlib/app/helper/vdata_generator.py", line 245, in rknn.base.rknnlib.app.helper.vdata_generator.VDataGenerator._parse_ovx_vdata
  18. T FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp_ta3hlyl/PNet.vdata'
  19. done
复制代码
模型文件详见附件



作者: 771488533    时间: 2019-3-8 16:42
没人帮忙解决一下吗。。。
作者: zhangzj    时间: 2019-3-8 16:59
771488533 发表于 2019-3-8 16:42
没人帮忙解决一下吗。。。

arm64版本的rknn-toolkit暂时还不支持pre_compile,
如果需要pre_compile,建议用x86版本的进行转换。
作者: 771488533    时间: 2019-3-12 14:08
zhangzj 发表于 2019-3-8 16:59
arm64版本的rknn-toolkit暂时还不支持pre_compile,
如果需要pre_compile,建议用x86版本的进行转换。 ...

mtcnn 的 P-net 模型输入尺寸是变化的,所以模型转换只能够在toybrick 开发板上完成




欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3