Toybrick

标题: caffemodel转rknn的问题 [打印本页]

作者: pjmhfhs    时间: 2020-12-24 14:37
标题: caffemodel转rknn的问题
我的prototxt内容只有这些
  1. name: "LeNet"
  2. layer {
  3.   name: "input"
  4.   type: "Input"
  5.   top: "data"
  6.   input_param {
  7.     shape {
  8.         dim: 1
  9.         dim: 3
  10.         dim: 32
  11.         dim: 32
  12.     }
  13.   }
  14. }
  15. layer {
  16.   name: "conv1"
  17.   type: "Convolution"
  18.   bottom: "data"
  19.   top: "conv1"
  20.   param {
  21.     lr_mult: 1
  22.   }
  23.   param {
  24.     lr_mult: 2
  25.   }
  26.   convolution_param {
  27.     num_output: 20
  28.     kernel_size: 5
  29.     stride: 1
  30.     weight_filler {
  31.       type: "xavier"
  32.     }
  33.     bias_filler {
  34.       type: "constant"
  35.     }
  36.   }
  37. }
复制代码
执行rknn.load_caffe(model='./lenet_train_test.prototxt', proto='caffe', blobs='./lenet_iter_10000.caffemodel')
报错
  1. E Catch exception when loading caffe model: /home/lwd/bak/model/lenet_train_test.prototxt!
  2. E Traceback (most recent call last):
  3. E   File "rknn/api/rknn_base.py", line 404, in rknn.api.rknn_base.RKNNBase.load_caffe
  4. E   File "rknn/base/RKNNlib/converter/caffeloader.py", line 1042, in rknn.base.RKNNlib.converter.caffeloader.CaffeLoader.load_blobs
  5. E   File "rknn/base/RKNNlib/converter/caffeloader.py", line 935, in rknn.base.RKNNlib.converter.caffeloader.CaffeLoader.parse_blobs
  6. E   File "rknn/base/RKNNlib/converter/caffeloader.py", line 358, in rknn.base.RKNNlib.converter.caffeloader.proc_blobs_convolution
  7. E   File "/home/lwd/.local/lib/python3.5/site-packages/numpy/core/fromnumeric.py", line 292, in reshape
  8. E     return _wrapfunc(a, 'reshape', newshape, order=order)
  9. E   File "/home/lwd/.local/lib/python3.5/site-packages/numpy/core/fromnumeric.py", line 56, in _wrapfunc
  10. E     return getattr(obj, method)(*args, **kwds)
  11. E ValueError: cannot reshape array of size 500 into shape (20,3,5,5)
复制代码
这个500是哪里出来的?caffemodel转rknn有教程吗?给个链接,感谢!

作者: pjmhfhs    时间: 2020-12-28 14:23
应该是caffemodel有问题




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