码迷,mamicode.com
首页 > 其他好文 > 详细

summer of 2016错误及解决汇总(1)

时间:2016-08-22 18:24:24      阅读:958      评论:0      收藏:0      [点我收藏+]

标签:

读入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

 

summer of 2016错误及解决汇总(1)

标签:

原文地址:http://www.cnblogs.com/chanyn/p/5796407.html

(0)
(1)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!