R-CNNを使った画像検出のプログラム
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Chihiro Nagatomo
le 30 Jan 2017
Commenté : Chihiro Nagatomo
le 31 Jan 2017
https://jp.mathworks.com/help/vision/ref/rcnnobjectdetector-class.html
上記URLのサンプルコードをもとに
load('car.mat', 'car', 'layers')
deepleaning.imageFilename = fullfile(toolboxdir('vision'),'visiondata', ...
deepleaning.imageFilename);
options = trainingOptions('sgdm', ...
'MiniBatchSize', 32, ...
'InitialLearnRate', 1e-6, ...
'MaxEpochs', 10, ...
'Verbose', false);
rcnn = trainRCNNObjectDetector(deepleaning(1:10,:), layers, options, ...
'NegativeOverlapRange', [0 0.3]);
network = rcnn.Network;
layers = network.Layers;
rcnnFinal = trainRCNNObjectDetector(deepleaning, layers, options);
というコードを入力したのですが
警告: 変数 'car' が見つかりません。
> In Untitled2 (line 1)
警告: 変数 'layers' が見つかりません。
> In Untitled2 (line 1)
変数 "deepleaning" またはクラス "deepleaning.imageFilename" は未定義です。
エラー: Untitled2 (line 4)
deepleaning.imageFilename);
というエラーが出ました。
学習させたかったものは car.matにあるcarがついているラベルで そのラベルを貼るために使った画像は deepleaningというフォルダ内にあります。 画像データの名前は1.jpgといったように数字のみの名前です。
どこが間違っているのか 宜しければお教えくださいますと幸いです。
2 commentaires
Réponse acceptée
mizuki
le 30 Jan 2017
Modifié(e) : mizuki
le 30 Jan 2017
変数 'car' が見つかりません。 という点が問題点のようです。 car.mat に、car や layers という変数が入っていますでしょうか。
>> load('car.mat', 'car', 'layers')
では、matファイル car.mat の matファイルに保存されている二つの変数 car と layers を読み込みしています。car.mat 内に変数 car や layers がない場合にエラーとなります。
まずは
>> clear all;
>> load('car.mat')
>> whos
を実行し、car.mat のファイルの中にどんな変数が入っているかどうかを確認するところから始めてみてはいかがでしょうか。
もし whos の結果を教えていただければフォローアップできるかと思います。
4 commentaires
Jiro Doke
le 30 Jan 2017
問題は二つあるかと思います。
まずは、アプリから Export ROIs したあとに car.mat に保存しましたか?(因みに、変数の保存の仕方は前に紹介しました MATLAB 入門 で紹介されています。)
ただ、それをしても、ご覧の通り layers という変数は存在しないので( car と labelingSession のみ)、後に load しても「変数 'layers' が見つかりません」と出てしまうのです。
layers は ニューラルネットワークのレイヤーなので、それは自分で定義しなくてはなりません。(サンプルコードでは既にそれが存在するサンプルデータを使っています)
参考にURLの中のこのサンプルをご覧下さい。
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Image Data Workflows dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!