I am getting error in function imds=imageDatastore(fullfile(rootFolder, categories), 'LabelSource', 'foldernames'); why?
古いコメントを表示
i am getting an error for above code in matlab 2016a
9 件のコメント
Walter Roberson
2016 年 6 月 1 日
Please show the complete error message, everything in red.
yogita
2016 年 6 月 1 日
編集済み: Walter Roberson
2016 年 6 月 1 日
yogita
2016 年 6 月 1 日
Walter Roberson
2016 年 6 月 1 日
That is not the complete error message. The complete error message would contain information such as "not enough input arguments" or "subscript out of range", and the complete error message would also show the complete traceback of the calls, showing where the above line was called from, which line called that, and so on.
yogita
2016 年 6 月 1 日
yogita
2016 年 6 月 1 日
Walter Roberson
2016 年 6 月 1 日
The trial license still gives complete error messages.
Have you considered the possibility of posting your actual code so that the people who are trying to help you do not have to make wild guesses about what might be wrong?
Please post the output of
which imageDatastore
yogita
2016 年 6 月 1 日
yogita
2016 年 6 月 1 日
編集済み: Walter Roberson
2016 年 6 月 1 日
回答 (2 件)
Walter Roberson
2016 年 6 月 1 日
You removed some of the code that is needed to download data. Go back to http://www.mathworks.com/examples/matlab-computer-vision/mw/vision_product-DeepLearningImageClassificationExample-image-category-classification-using-deep-learning and pull out the entire code.
In particular you need the lines
if ~exist(outputFolder, 'dir') % download only once
disp('Downloading 126MB Caltech101 data set...');
untar(url, outputFolder);
end
and
% Location of pre-trained "AlexNet"
cnnURL = 'http://www.vlfeat.org/matconvnet/models/beta16/imagenet-caffe-alex.mat';
and
if ~exist(cnnMatFile, 'file') % download only once
disp('Downloading pre-trained CNN model...');
websave(cnnMatFile, cnnURL);
end
Arthur
2018 年 4 月 6 日
Consider to adapt your code to:
path = char(path) %pass to this variable your complet data set path
categories = {'airplanes', 'ferry', 'laptop'};
imds = imageDatastore(fullfile(path, categories), 'LabelSource', 'foldernames');
tbl = countEachLabel(imds);
カテゴリ
ヘルプ センター および File Exchange で Image Data Workflows についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!