combined datastore for regression model with multiple input
3 ビュー (過去 30 日間)
古いコメントを表示
I need combined datastore like below:
data = read(ds)
data =
100×3 cell array
{128×128×3 uint8} {128×128×3 uint8} {[0.8]}
{128×128×3 uint8} {128×128×3 uint8} {[1.2]}
{128×128×3 uint8} {128×128×3 uint8} {[4.4]}
{128×128×3 uint8} {128×128×3 uint8} {[0.9]}
...
Fist column and second column are (multiple) input data for CNN,
and last column is responses.
(As stated in the docmentation, For networks with multiple inputs, the datastore must be a combined or transformed datastore that returns a cell array with (numInputs+1) columns containing the predictors and the responses, where numInputs is the number of network inputs and numResponses is the number of responses.)
I prepared two kinds of image file folder, which are corresponding to first column and second column.
The problem is about third column.
I prepared .csv file of the response values, and made a tabularTextDatastore with the file.
And then I transformed it to cell type data in order to combine it with the other two datastores.
dsnew = transform(ds,@(x) table2cell(x))
But after combine these three datastores, ds.readall comand showed an error about horzcat, which tells that demensions of the arrays are not consistent.
I confirmed the dimensions of all datastores, but all of them are "1000 x 1 cell array".
How can I solve this problem?
2 件のコメント
Nimit Dhulekar
2020 年 3 月 18 日
Hi Mariko, what is the ReadSize for the TabularTextDatastore? It is possible that the ReadSize is set to its default value of 20000 and that is what is tripping up the readall horzcat.
Can you please post the code you used to construct the 3 datastores.
Ziqi Wu
2022 年 9 月 23 日
found another thread here might be helpful, convert to table data type
https://www.mathworks.com/matlabcentral/answers/372698-deep-learning-how-do-i-add-regression-ground-truth-data-to-an-imagedatastore#answer_297023
回答 (1 件)
Jayanti
2025 年 3 月 25 日
Hi Mariko,
The issue might be due to the different read size properties of all the datastores. To resolve this, keep the same read size value for all underlying datastores.
You can also refer to below similar matlab answer for your reference:
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!