R-CNNでのクラス名におけるエラーについて
조회 수: 3 (최근 30일)
이전 댓글 표시
R-CNNを用いて物体検出を行いたいと考えています。
以下のCNNの層構造において
![層.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/249356/image.jpeg)
15層目のプロパティ、およびclassは以下のようになっています。
![15層目.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/249357/image.jpeg)
![15層目カテゴリ.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/249358/image.jpeg)
学習データのクラス名は以下のようになっています。
![学習データ.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/249359/image.jpeg)
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일
まずは、こちらをご参考にしてみては如何でしょうか?
あとは、作成したネットワークの整合性チェックをディープネットワークデザイナーから行えます。
![キャプチャ.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/249878/%E3%82%AD%E3%83%A3%E3%83%97%E3%83%81%E3%83%A3.png)
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!