学习深度学习,经常会遇到一个问题,那就是如何对深度学习的模型进行可视化,以yolo为例,这是yolov2-tiny-voc.cfg 的配置文件:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
|
[net] # Testing batch=1 subdivisions=1 # Training # batch=64 # subdivisions=2 width=416 height=416 channels=3 momentum=0.9 decay=0.0005 angle=0 saturation = 1.5 exposure = 1.5 hue=.1 learning_rate=0.001 max_batches = 40200 policy=steps steps=-1,100,20000,30000 scales=.1,10,.1,.1 [convolutional] batch_normalize=1 filters=16 size=3 stride=1 pad=1 activation=leaky [maxpool] size=2 stride=2 [convolutional] batch_normalize=1 filters=32 size=3 stride=1 pad=1 activation=leaky [maxpool] size=2 stride=2 [convolutional] batch_normalize=1 filters=64 size=3 stride=1 pad=1 activation=leaky [maxpool] size=2 stride=2 [convolutional] batch_normalize=1 filters=128 size=3 stride=1 pad=1 activation=leaky [maxpool] size=2 stride=2 [convolutional] batch_normalize=1 filters=256 size=3 stride=1 pad=1 activation=leaky [maxpool] size=2 stride=2 [convolutional] batch_normalize=1 filters=512 size=3 stride=1 pad=1 activation=leaky [maxpool] size=2 stride=1 [convolutional] batch_normalize=1 filters=1024 size=3 stride=1 pad=1 activation=leaky ########### [convolutional] batch_normalize=1 size=3 stride=1 pad=1 filters=1024 activation=leaky [convolutional] size=1 stride=1 pad=1 filters=125 activation=linear [region] anchors = 1.08,1.19, 3.42,4.41, 6.63,11.38, 9.42,5.11, 16.62,10.52 bias_match=1 classes=20 coords=4 num=5 softmax=1 jitter=.2 rescore=1 object_scale=5 noobject_scale=1 class_scale=1 coord_scale=1 absolute=1 thresh = .6 random=1 |
光看这个配置文件,我们可能很难看出它到底是怎样的结构,这时,可以祭出这个模型可视化的神器了,地址:
https://www.machunjie.com/dl/Visualization/index.html
目前支持的格式:
ONNX (.onnx
, .pb
, .pbtxt
), Keras (.h5
, .keras
), Core ML (.mlmodel
), Caffe (.caffemodel
, .prototxt
), Caffe2 (predict_net.pb
, predict_net.pbtxt
), MXNet (.model
, -symbol.json
), TorchScript (.pt
, .pth
), NCNN (.param
) and TensorFlow Lite (.tflite
).
PyTorch (.pt
, .pth
), Torch (.t7
), CNTK (.model
, .cntk
), Deeplearning4j (.zip
), PaddlePaddle (.zip
, __model__
), Darknet (.cfg
), scikit-learn (.pkl
), TensorFlow.js (model.json
, .pb
) and TensorFlow (.pb
, .meta
, .pbtxt
).
远程调用:
https://www.machunjie.com/dl/Visualization/index.html?url=模型文件地址
如:https://www.machunjie.com/dl/Visualization/index.html?url=https://ibelem.github.io/webml-website/examples/image_classification/model/squeezenet1.1.onnx
本文最后更新于2019年9月10日,已超过 1 年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!
如果你对这篇文章有什么疑问或建议,欢迎下面留言提出,我看到会立刻回复!
打赏