Caffe hints and tips

  1. When declaring the network location in your solver file, it is relative to the directory that your project resides in.
  2. Caffe’s input layer for training allows you specify what the dimensions of each input should be. So for an example input layer,
    layer {
    name: "input"
    type: "Input"
    top: "input"
    top: "label"
    input_param {
    shape: {
    dim: 8
    dim: 1
    dim: 1
    dim: 1
    }
    shape: {
    dim: 8
    dim: 1
    dim: 7
    dim: 1
    }
    }

    include: {
    phase: TRAIN
    }
    }

    The order for which the shape declarations occur correspond to the order of the top declarations. So, the top field “input” has a batch size of 8 followed by a channel of 1, height of 1, and width of 1. Top field “label” has a batch size of 8, channel of 1, width of 7, height of 1. This is important when you have multiple outputs for each input and you have to tell Caffe that the amount of labels you provide will match the amount of outputs in total. Otherwise, you’ll get an error.