R-CNNでのクラス名におけるエラーについて
3 ビュー (過去 30 日間)
古いコメントを表示
R-CNNを用いて物体検出を行いたいと考えています。
以下のCNNの層構造において

15層目のプロパティ、およびclassは以下のようになっています。


学習データのクラス名は以下のようになっています。

rcnn = trainRCNNObjectDetector(data, layers, options, 'NegativeOverlapRange', [0 0.3]);を処理している際、
"ニューラル ネットワークに学習データ内のオブジェクトを分類させるための学習を実行中"において
下記のようなエラーが出てしまいました。
エラー: trainNetwork (line 150)
層 15 のクラス名は、学習データのクラス名と一致しなければなりません。学習データのクラス名は categories(Y) で指定されます。ここで、Y は学習データのラベルです。
エラー: rcnnObjectDetector.train (line 239)
[net, info] = trainNetwork(dispatcher, layers, opts);
エラー: trainRCNNObjectDetector (line 280)
[detector, ~, info] = rcnnObjectDetector.train(trainingData, lgraphOrLayers, options, params);
エラー: Untitled_36 (line 16)
rcnn = trainRCNNObjectDetector(data, layers, options, 'NegativeOverlapRange', [0 0.3]);
上記のようなエラーが出てしまい、実行できません。どのように改善を行えばよいのでしょうか。
よろしくお願いいたします。
9 件のコメント
採用された回答
Kazuya
2019 年 11 月 28 日
こちらに回答として転記しておきます。
****
学習済みのネットワークは positive/nagative の2クラス分類を行うものですが、学習データに positive が無いのが原因の様です。
tmp = net.Layers;
layers = [tmp(1:end-1)
classificationLayer];
と classificationLayer だけ新しいものするとエラーは解決します。
0 件のコメント
その他の回答 (1 件)
Hiro Yoshino
2019 年 11 月 25 日
まずは、こちらをご参考にしてみては如何でしょうか?
あとは、作成したネットワークの整合性チェックをディープネットワークデザイナーから行えます。

0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!