alexnetの転移学習を試みています.
フレームワークはcaffe,転移学習に使用しているデータセットはcaltech101です.
caltech101の内2クラス分だけを使用しleveldbファイルを作成し(サイズは256です),
train_val.prototxt,solver.prototxt,deploy.prototxtを書き換えて転移学習を実行したところ,以下のようなエラーが出ました.
Cannot copy param 0 weights from layer 'conv1'; shape mismatch. Source param shape is 96 3 11 11 (34848); target param shape is 96 1 11 11 (11616). To learn this layer's parameters from scratch rather than copying from a saved net, rename the layer.
caltech101を使用しているのでRGB画像のはずなのですが,どこかで白黒になってしまっているようです.
恐れ入りますがどなたか解決法をご教授頂ければ幸いです.
deploy.prototxtとtrain_val.prototxtは以下の通りです.
【deploy.prototxt】 name: "AlexNet" layer { name: "data" type: "Input" top: "data" input_param { shape: { dim: 10 dim: 3 dim: 256 dim: 256 } } } layer { name: "conv1" type: "Convolution" bottom: "data" top: "conv1" param { lr_mult: 1 decay_mult: 1 } (中略) layer { name: "fc8ft" type: "InnerProduct" bottom: "fc7" top: "fc8ft" param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0 } inner_product_param { num_output: 2 } } layer { name: "prob" type: "Softmax" bottom: "fc8ft" top: "prob" }
【train_val.prototxt】 name: "AlexNet" layer { name: "data" type: "Data" top: "data" top: "label" include { phase: TRAIN } transform_param { mirror: true crop_size: 227 mean_file: "fine_tuned_alex/caltech101_mean.binaryproto" } data_param { source: "fine_tuned_alex/caltech101_train_leveldb" batch_size: 256 backend: LMDB } } layer { name: "data" type: "Data" top: "data" top: "label" include { phase: TEST } transform_param { mirror: false crop_size: 227 mean_file: "fine_tuned_alex/caltech101_mean.binaryproto" } data_param { source: "fine_tuned_alex/caltech101_val_leveldb" batch_size: 50 backend: LMDB } } layer { name: "conv1" type: "Convolution" bottom: "data" top: "conv1" param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0 } (中略) layer { name: "fc8ft" type: "InnerProduct" bottom: "fc7" top: "fc8ft" param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0 } inner_product_param { num_output: 2 weight_filler { type: "gaussian" std: 0.01 } bias_filler { type: "constant" value: 0 } } } layer { name: "accuracy" type: "Accuracy" bottom: "fc8ft" bottom: "label" top: "accuracy" include { phase: TEST } } layer { name: "loss" type: "SoftmaxWithLoss" bottom: "fc8ft" bottom: "label" top: "loss" }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。