标签:
读入Net时发生:
Error parsing text-format caffe.NetParameter: 64:7: Message type "caffe.LayerParameter" has no field named "layer".
Reson:
prototxt文件格式出错,line 64 缺少‘}’
python Visualize param:=>plt.imshow()
TypeError: Invalid dimensions for image data
Reason:
plt.imshow() needs a 2D array (or a 3D array with the third dimension being of shape 3 or 4)!
# Assuming your array/image has the variable name: array import numpy as np np.asarray(array).ndim # If the result is 2 you can always use it with imshow # If the result is 3 you need to check the third dimension: np.asarray(array).shape[2] # Must be 3 or 4 for RGB or RGBA images
Train a reformed AlexNet,keep conv layer input size,transform fc layers to conv which kernel size is 1*1.But loss is shocking and Net cannot converge.
By visualizing each Layer parameters and Blob,find conv6/conv7(kernel = 1*1) parameters are all zero!
Reason:
conv6/conv7 in train_val.prototxt cannot initialize.
convolution_param {
num_output: 1
bias_term: false
kernel_size: 16
stride: 8
pad: 4
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0.1
}
}
Or:利用已有的caffemodel fine-tuning
在训练脚本中加上:-weights=models/bvlc_alexnet/bvlc_alexnet.caffemodel
标签:
原文地址:http://www.cnblogs.com/chanyn/p/5796407.html