Problem with the prototxt

325 views
Skip to first unread message

ras

unread,
Apr 27, 2015, 4:18:37 AM4/27/15
to caffe...@googlegroups.com
Hi
I use the following prototx to train my network. However, it never learns anything and loss function stays the same and never decreases/changes (e.g Train net output #0: loss = 87.3365 (* 1 = 87.3365 loss)). Different learning rates have been applied but no luck. 
Is there something wrong the following prototox file?Is there any parameter is missing? I wanna to make sure that the problem is not from prototxt file.

Any help would be appreciated.


name: "test_my_net"
layers
{
  name
: "data"
  type
: HDF5_DATA
  top
: "data"
  top
: "label"
  hdf5_data_param
{
    source
: "my_train_data.txt"
    batch_size
: 25
 
}
  include
:
   
{
    phase
: TRAIN
   
}
}
layers
{
  name
: "data"
  type
: HDF5_DATA
  top
: "data"
  top
: "label"
  hdf5_data_param
{
    source
: "my_test_data.txt"
    batch_size
: 25
 
}
  include
: { phase: TEST }
}
layers
{
  name
: "conv1"
  type
: CONVOLUTION
  bottom
: "data"
  top
: "conv1"
  weight_decay
: 1
  weight_decay
: 0
  convolution_param
{
    num_output
: 48
    kernel_size
: 4
    stride
: 1
    weight_filler
{
      type
: "gaussian"
      std
: 0.01
   
}
    bias_filler
{
      type
: "constant"
      value
: 0
   
}
 
}
}
layers
{
  name
: "relu1"
  type
: RELU
  bottom
: "conv1"
  top
: "conv1"
}
layers
{
  name
: "pool1"
  type
: POOLING
  bottom
: "conv1"
  top
: "pool1"
  pooling_param
{
    pool
: MAX
    kernel_size
: 2
    stride
: 2
 
}
}
layers
{
  name
: "conv2"
  type
: CONVOLUTION
  bottom
: "pool1"
  top
: "conv2"
  weight_decay
: 1
  weight_decay
: 0
  convolution_param
{
    num_output
: 48
    kernel_size
: 5
    stride
: 1
    weight_filler
{
      type
: "gaussian"
      std
: 0.01
   
}
    bias_filler
{
      type
: "constant"
      value
: 1
   
}
 
}
}
layers
{
  name
: "relu2"
  type
: RELU
  bottom
: "conv2"
  top
: "conv2"
}
layers
{
  name
: "pool2"
  type
: POOLING
  bottom
: "conv2"
  top
: "pool2"
  pooling_param
{
    pool
: MAX
    kernel_size
: 2
    stride
: 2
 
}
}
layers
{
  name
: "conv3"
  type
: CONVOLUTION
  bottom
: "pool2"
  top
: "conv3"
  weight_decay
: 1
  weight_decay
: 0
  convolution_param
{
    num_output
: 48
    kernel_size
: 4
    stride
: 1
    weight_filler
{
      type
: "gaussian"
      std
: 0.01
   
}
    bias_filler
{
      type
: "constant"
      value
: 0
   
}
 
}
}
layers
{
  name
: "relu3"
  type
: RELU
  bottom
: "conv3"
  top
: "conv3"
}
layers
{
  name
: "pool3"
  type
: POOLING
  bottom
: "conv3"
  top
: "pool3"
  pooling_param
{
    pool
: MAX
    kernel_size
: 2
    stride
: 2
 
}
}


layers
{
  name
: "conv4"
  type
: CONVOLUTION
  bottom
: "pool3"
  top
: "conv4"
  weight_decay
: 1
  weight_decay
: 0
  convolution_param
{
    num_output
: 48
    stride
: 1
    kernel_size
: 4
   
group: 2
    weight_filler
{
      type
: "gaussian"
      std
: 0.01
   
}
    bias_filler
{
      type
: "constant"
      value
: 1
   
}
 
}
}
layers
{
  name
: "relu4"
  type
: RELU
  bottom
: "conv4"
  top
: "conv4"
}
layers
{
  name
: "pool4"
  type
: POOLING
  bottom
: "conv4"
  top
: "pool4"
  pooling_param
{
    pool
: MAX
    kernel_size
: 2
    stride
: 2
 
}
}
layers
{
  name
: "fc5"
  type
: INNER_PRODUCT
  bottom
: "pool4"
  top
: "fc5"
  weight_decay
: 1
  weight_decay
: 0
  inner_product_param
{
    num_output
: 200
    weight_filler
{
      type
: "gaussian"
      std
: 0.005
   
}
    bias_filler
{
      type
: "constant"
      value
: 1
   
}
 
}
}
layers
{
  name
: "relu5"
  type
: RELU
  bottom
: "fc5"
  top
: "fc5"
}
layers
{
  name
: "fc6"
  type
: INNER_PRODUCT
  bottom
: "fc5"
  top
: "fc6"
  weight_decay
: 1
  weight_decay
: 0
  inner_product_param
{
    num_output
: 2
    weight_filler
{
      type
: "gaussian"
      std
: 0.01
   
}
    bias_filler
{
      type
: "constant"
      value
: 0
   
}
 
}
}


layers
{
  name
: "loss"
  type
: SOFTMAX_LOSS
  bottom
: "fc6"
  bottom
: "label"
  top
:"loss"
}
layers
{
  name
: "accuracy"
  type
: ACCURACY
  bottom
: "fc6"
  bottom
: "label"
  top
: "accuracy"
  include
: { phase: TEST }
}



npit

unread,
Apr 28, 2015, 8:23:14 AM4/28/15
to caffe...@googlegroups.com
Is your data / text file ok?
Try using a bvlc provided prototxt and pass your data to check if you are having the same problem. If you are, there's something up with your images or your text file.
You will only need to edit the train,test data layers.

ras

unread,
Apr 28, 2015, 1:15:10 PM4/28/15
to caffe...@googlegroups.com
Thanks  for your reply. 

I guess the data are ok. I've tested this prototxt with different data set, it  worked. However, the only difference this new data( the one working) set were RGB images. My original images are grayscale ones. I thought since data are grayscale I have to set some flag/parameter in the prototxt.
...

Amir Abdi

unread,
Dec 1, 2015, 9:50:50 PM12/1/15
to Caffe Users
I have the exact same problem. My dataset is also grayscale. and I get to the same loss:  loss = 87.3365 (* 1 = 87.3365 loss)
Did you find any solutions?
...

ras

unread,
Dec 1, 2015, 10:32:23 PM12/1/15
to Caffe Users
My problem was with data. Have you checked your data? I found my problem by sth like this: max(data) and min(data). There ware NaN values in my data.
Reply all
Reply to author
Forward
0 new messages