ディープラーニング 転移学習について 画像のサイズを変更し​て、splitEac​hLabelを使う方​法

3 ビュー (過去 30 日間)
洋生 福光
洋生 福光 2020 年 5 月 29 日
編集済み: Shunichi Kusano 2020 年 5 月 30 日
ディープラーニングでAlexnet を使用する際の質問です。転移学習でラベルの変更として学習させる画像を入れる際に、画像サイズを[227 227]に変更するのですが、その際にaugmentedImageDatastoreで画像のサイズを変更し、ランダムに分けてsplitEachLabelで分けたいのですが、エラーがでてしまいます。matlabのサイトで確認しても、augmentedImageDatastoreとsplitEachLabelを同時に使用している例はないので、どのように解決するかがわかりません。エラーが出た文を以下に張っております。どなたかわかる方いたらお願いします。
a = imageDatastore('myImages', 'IncludeSubfolders', true, 'LabelSource', 'foldernames');
allimages = augmentedImageDatastore([227 227],a)
[trainingImages, testImages] = splitEachLabel(allImages, 0.7, 'randomize');

採用された回答

Shunichi Kusano
Shunichi Kusano 2020 年 5 月 29 日
編集済み: Shunichi Kusano 2020 年 5 月 30 日
こんにちは。
大元のimageDatastoreをsplitEachLabelで分けた後、training用のimagedatastoreにのみaugmentationをします(augmentedImageDatastoreにする)。augmentationをする理由は、training時に手持ちの画像のバリエーションを疑似的に増やすことで、学習するモデルをロバストにするためなので、test用のものにaugmentationは不要となります。
このへんややこしいですよね。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchangeイメージを使用した深層学習 についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!