質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
深層学習

深層学習は、多数のレイヤのニューラルネットワークによる機械学習手法。人工知能研究の一つでディープラーニングとも呼ばれています。コンピューター自体がデータの潜在的な特徴を汲み取り、効率的で的確な判断を実現することができます。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

Q&A

解決済

1回答

2155閲覧

alexnetの転移学習,pram shapeのエラーについて

katherine

総合スコア13

深層学習

深層学習は、多数のレイヤのニューラルネットワークによる機械学習手法。人工知能研究の一つでディープラーニングとも呼ばれています。コンピューター自体がデータの潜在的な特徴を汲み取り、効率的で的確な判断を実現することができます。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

0グッド

0クリップ

投稿2018/06/21 13:44

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" }

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

DBファイルを作成する際に-grayコマンドが入っていたことが原因でした.

投稿2018/06/25 01:14

katherine

総合スコア13

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問