Object Localization: Learning a "mask"

219 views
Skip to first unread message

Praveen O

unread,
Dec 27, 2015, 2:00:06 PM12/27/15
to Caffe Users
The training set consists of images (3x256x256), along with a mask label (256x256 - can be viewed as a grayscale image). I created LMDB for both the images and masks using create_imagenet.sh

Is my network definition correct:

train.prototxt

layer {
  name: "data"
  type: "Data"
  top: "data"
  transform_param {
    scale: 0.00392156862745
    mirror: true
  }
  data_param {
    source: "images/train_lmdb"
    batch_size: 8
    backend: LMDB
  }
}
layer {
  name: "mask"
  type: "Data"
  top: "mask"
  transform_param {
    scale: 0.00392156862745
    mirror: true
  }
  data_param {
    source: "images/mask_point1_lmdb"
    batch_size: 8
    backend: LMDB
  }
}
layer {
  name: "conv"
  type: "Convolution"
  bottom: "data"
  top: "conv"
  convolution_param {
    num_output: 16
    kernel_size: 3
    weight_filler {
      type: "gaussian"
      std: 0.1
    }
  }
}
layer {
  name: "conv_bn"
  type: "BatchNorm"
  bottom: "conv"
  top: "conv_bn"
}
layer {
  name: "relu1"
  type: "ReLU"
  bottom: "conv_bn"
  top: "conv_bn"
}
layer {
  name: "deconv"
  type: "Deconvolution"
  bottom: "conv_bn"
  top: "deconv"
  convolution_param {
    num_output: 1
    kernel_size: 3
    weight_filler {
      type: "gaussian"
      std: 0.1
    }
  }
}
layer {
  name: "deconv_bn"
  type: "BatchNorm"
  bottom: "deconv"
  top: "deconv_bn"
}
layer {
  name: "logistic"
  type: "Sigmoid"
  bottom: "deconv_bn"
  top: "deconv_bn"
}
layer {
  name: "loss"
  type: "EuclideanLoss"
  bottom: "mask"
  bottom: "deconv_bn"
  top: "loss"
}

solver.prototxt

# The train/test net protocol buffer definition
net: "train/point1.prototxt"
test_state: { stage: 'test-on-train' }
test_iter: 600
test_interval: 600
test_compute_loss: true
type: "AdaDelta"
gamma: 0.0001
base_lr: 0.1
momentum: 0.95
delta: 1e-6
weight_decay: 0.0005
power: 0.75
lr_policy: "fixed"
display: 600
max_iter: 24000
snapshot_prefix: "model_1"
solver_mode: GPU

I see this error :

I1227 10:44:38.112040 2063626240 layer_factory.hpp:77] Creating layer data

I1227 10:44:38.112077 2063626240 net.cpp:106] Creating Layer data

I1227 10:44:38.112082 2063626240 net.cpp:411] data -> data

F1227 10:44:38.115083 528384 data_reader.cpp:98] Check failed: new_queue_pairs_.size() == 0 (1 vs. 0) 

Etienne Perot

unread,
Feb 11, 2016, 12:09:22 PM2/11/16
to Caffe Users
I have the exact same error...when using newest caffe... did you  solve your problem?
Message has been deleted

Etienne Perot

unread,
Feb 11, 2016, 12:27:04 PM2/11/16
to Caffe Users
EDIT :  i have solved this by putting the validation data layers for labels AND image.

layer {
  name: "image"
  type: "Data"
  top: "Data1"
  include{phase: TRAIN}
  data_param {
    source: "/home/valeodevbox/SegNet/mscoco_40k/train/image.lmdb"
    batch_size: 32
    backend: LMDB
  }
}
layer {
  name: "image"
  type: "Data"
  top: "Data1"
  include{phase: TEST}
  data_param {
    source: "/home/valeodevbox/SegNet/mscoco_40k/test/image.lmdb"
    batch_size: 32
    backend: LMDB
  }
layer {
  name: "label"
  type: "Data"
  top: "Data2"
  include{phase: TRAIN}
  data_param {
    source: "/home/valeodevbox/SegNet/mscoco_40k/train/label.lmdb"
    batch_size: 32
    backend: LMDB
  }
}
layer {
  name: "label"
  type: "Data"
  top: "Data2"
  include{phase: TEST}
  data_param {
    source: "/home/valeodevbox/SegNet/mscoco_40k/test/label.lmdb"
    batch_size: 32
    backend: LMDB
  }
}
Reply all
Reply to author
Forward
0 new messages