Why accept Matlab no vector as a response when I use CNN with residual connection?

1 回表示 (過去 30 日間)
Osama Tabbakh
Osama Tabbakh 2019 年 5 月 22 日
コメント済み: Zezhong Wang 2021 年 5 月 26 日
I train my own CNN model like this tutorial:
but I need no classification layer at the end my neural network, but regression layer. That's why I need to define a vector for each sample. All in all, I have to train a matrix(40*num_of_samples), which must be converted into a 4D array like this tutorial:
I get this error:
Invalid validation data. Y must be a vector of categorical responses.
Does someone know how I can fix this?
  3 件のコメント
Osama Tabbakh
Osama Tabbakh 2019 年 5 月 29 日
Let say this is my input images:
X_Train(:,:,3,3000) = rand(100);
my outputs are defined like this:
Y_4D_train=randn(1,1,40,3000);
and the data for validation:
X_Val(:,:,3,1000) = rand(100);
Y_4D_Val =randn(1,1,40,1000);
and then I did like the tutorial:
imageSize = [100 100 3];
pixelRange = [-4 4];
imageAugmenter = imageDataAugmenter( ...
'RandXReflection',true, ...
'RandXTranslation',pixelRange, ...
'RandYTranslation',pixelRange);
augimdsTrain = augmentedImageDatastore(imageSize,X_Train,Y_4D_train, ...
'DataAugmentation',imageAugmenter, ...
'OutputSizeMode','randcrop');
...
...
At the end:
trainedNet = trainNetwork(augimdsTrain,lgraph,options);
Zezhong Wang
Zezhong Wang 2021 年 5 月 26 日
Same problem here.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by