shicai / DenseNet-Caffe

DenseNet Caffe Models, converted from https://github.com/liuzhuang13/DenseNet
357 stars 274 forks source link

when i train my own dataset,the loss is not decrease and it is always about 6.97 #26

Open jackchowtop1 opened 6 years ago

jackchowtop1 commented 6 years ago

the following is my solver.prototxt: net: "examples/re_identification/DenseNet_201.prototxt" test_iter: 5000 test_interval: 1000 base_lr: 0.01 lr_policy: "step" gamma: 0.1 stepsize: 1000 display: 20 max_iter: 10000 momentum: 0.9 weight_decay: 0.0005 snapshot: 1000 snapshot_prefix: "examples/re_identification/caffenet_train" solver_mode: GPU

and i add some code in your DenseNet.prototxt at the beginning: name: "DENSENET_201" layer { name: "data" type: "Data" top: "data" top: "label" include { phase: TRAIN } transform_param { crop_size: 224 mean_value: 90 mean_value: 102 mean_value: 100 mirror: true } data_param { source: "/home/zhou/caffe/examples/re_identification/img_train_lmdb" batch_size: 1 backend: LMDB } } layer { name: "data" type: "Data" top: "data" top: "label" include { phase: TEST } transform_param { crop_size: 224 mean_value: 90 mean_value: 102 mean_value: 100 mirror: false } data_param { source: "/home/zhou/caffe/examples/re_identification/img_test_lmdb" batch_size: 1 backend: LMDB } } layer { name: "conv1" type: "Convolution" bottom: "data" top: "conv1" convolution_param { num_output: 64 bias_term: false pad: 3 kernel_size: 7 stride: 2 } ... ... ... at the end i add: layer { name: "fc6" type: "Convolution" bottom: "pool5" top: "fc6" convolution_param { num_output: 1000 kernel_size: 1 } } layer { name: "accuracy" type: "Accuracy" bottom: "fc6" bottom: "label" top: "accuracy" include { phase: TEST } } layer { name: "loss" type: "SoftmaxWithLoss" bottom: "fc6" bottom: "label" top: "loss" } and the label of my dataset is 0 to 999 i do not know why my loss is not decrease and keep the value about 6.9

kouyoumin commented 6 years ago

Try adding weight_filler { type: "msra" } to convolution_param