MNNDump2Json

将MNN模型bin文件 dump 成可读的类json格式文件,以方便对比原始模型参数。

  1. ./MNNDump2Json ../../../resource/model/MobileNet/v2/mobilenet_v2.caffe.mnn output.json
  2. cat output.json
  3. { oplists:
  4. [
  5. { type: Input, name: "data", outputIndexes:
  6. [ 0 ]
  7. , main_type: Input, main:
  8. { dims:
  9. [ 1, 3, ... ]
  10. }
  11. }
  12. ,
  13. { type: Convolution, name: "conv1", inputIndexes:
  14. [ 0 ]
  15. , outputIndexes:
  16. [ 1 ]
  17. , main_type: Convolution2D, main:
  18. { common:
  19. { dilateX: 1, dilateY: 1, strideX: 2, strideY: 2, kernelX: 3, kernelY: 3, padX: 1, padY: 1, group: 1, outputCount: 32, relu: true }
  20. , weight:
  21. [ -0.113041, 0.15978, ... ]
  22. , bias:
  23. [ 0.61395, 2.009104, ... ]
  24. }
  25. }
  26. ,
  27. ...
  28. ]
  29. , tensorName:
  30. [ "data", "conv1/bn", "conv2_1/expand/bn", "conv2_1/dwise/bn", "conv2_1/linear/bn", "conv2_2/expand/bn", "conv2_2/dwise/bn", "conv2_2/linear/bn", "conv3_1/expand/bn", "conv3_1/dwise/bn", "conv3_1/linear/bn", "block_3_1", "conv3_2/expand/bn", "conv3_2/dwise/bn", "conv3_2/linear/bn", "conv4_1/expand/bn", "conv4_1/dwise/bn", "conv4_1/linear/bn", "block_4_1", "conv4_2/expand/bn", "conv4_2/dwise/bn", "conv4_2/linear/bn", "block_4_2", "conv4_3/expand/bn", "conv4_3/dwise/bn", "conv4_3/linear/bn", "conv4_4/expand/bn", "conv4_4/dwise/bn", "conv4_4/linear/bn", "block_4_4", "conv4_5/expand/bn", "conv4_5/dwise/bn", "conv4_5/linear/bn", "block_4_5", "conv4_6/expand/bn", "conv4_6/dwise/bn", "conv4_6/linear/bn", "block_4_6", "conv4_7/expand/bn", "conv4_7/dwise/bn", "conv4_7/linear/bn", "conv5_1/expand/bn", "conv5_1/dwise/bn", "conv5_1/linear/bn", "block_5_1", "conv5_2/expand/bn", "conv5_2/dwise/bn", "conv5_2/linear/bn", "block_5_2", "conv5_3/expand/bn", "conv5_3/dwise/bn", "conv5_3/linear/bn", "conv6_1/expand/bn", "conv6_1/dwise/bn", "conv6_1/linear/bn", "block_6_1", "conv6_2/expand/bn", "conv6_2/dwise/bn", "conv6_2/linear/bn", "block_6_2", "conv6_3/expand/bn", "conv6_3/dwise/bn", "conv6_3/linear/bn", "conv6_4/bn", "pool6", "fc7", "prob" ]
  31. , bizCode: "0000" }