Error using trainnet with multiple inputs with Feature-Feature Regression Network

8 ビュー (過去 30 日間)
Imola Fodor
Imola Fodor 2024 年 11 月 14 日
回答済み: Imola Fodor 2024 年 11 月 14 日
Hello,
I have an error :
Error using trainnet (line 54)
Number of input data formats (1) and number of network inputs (2) must match.
analyzeNetwork(net)
I call trainnet with:
netTrained = trainnet(dsTrain, net,'mse',options)
Options being:
options = trainingOptions("adam", ...
InitialLearnRate=0.0005, ...
MaxEpochs=50, ...
MiniBatchSize=3, ...
InputDataFormats = "CB", ...
TargetDataFormats = "CB", ...
Verbose= false, ...
Plots="training-progress");
The dsTrain is a CombinedDatastore contains the feats the metadata and the target value and is formed such that on the command read I get the following ans:
read(dsTrain)
ans =
1×3 cell array
{9×1 double} {10×1 double} {[17.6004]}
I have tried also to have a dsTrainX and dsTrainY separately and feed them separately to trainnet, without luck.
I have 10 observations. I am aware of the small dataset, but it is simply a sample and the goal is to make the example run successfully.
With trainNetwork I don't have any problems, the data there was of a different data format but when translating through Deep Network Designer to trainnet errors occured regarding the InputDataFormat, so once I went through those errors, now I have this one.
Hope someone could help
Greets
Imola

採用された回答

Imola Fodor
Imola Fodor 2024 年 11 月 14 日
OK, the solution to this particular problem is putting the option InputDataFormats as:
InputDataFormats = {'CB','CB'}, ...
I have trained with trainNetwork CB, CB formatted inputs and there was no need to specify this change in the options.
When the Deep Learning Designer generated code to have the topology in dlnetwork style, the InputDataFormats and TargetDataFormats options were not adapted to this "network type change".

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by