Azzera filtri
Azzera filtri

Cannot find files or folders matching: 'recycle10​1\project\​aluminiumc​an'.

5 visualizzazioni (ultimi 30 giorni)
clc
clear all; close all;
outputFolder=fullfile('recycle101');
rootFolder=fullfile(outputFolder,'project');
categories={'aluminiumcan','petbottles','drinkcartonbox'};
imds=imageDatastore(fullfile(rootFolder,categories),'LabelSource','foldernames');
tbl=countEachLabel(imds)
Error:
>> imds=imageDatastore(fullfile(rootFolder,categories),'LabelSource','foldernames');
tbl=countEachLabel(imds)
Error using imageDatastore
Cannot find files or folders matching: 'recycle101\project\aluminiumcan'.
  4 Commenti
Tan
Tan il 13 Mag 2023
but my MATLAB install at hard-disk and the dataset is saved at local disk.
Does it will affect and get the error as below?
Error using imageDatastore
Cannot find files or folders matching: 'recycle101\project\aluminiumcan'.
Walter Roberson
Walter Roberson il 13 Mag 2023
what does this report?
parts = {'recycle101', 'project', 'aluminiumcan'};
if exist(parts{1}, 'dir')
fprintf('folder "%s" exists!\n', parts{1});
if exists(fullfile(parts{1:2}), 'dir')
fprintf('folder "%s" exists!\n', fullfile(parts{1:2}));
if exists(fulfile(parts{1:3}), 'dir')
fprintf('folder "%s" exists!\n', fullfile(parts{1:3}));
else
fprintf('but could not find subfolder "%s"\n', parts{3});
end
else
fprintf('but could not find subfolder "%s"\n', parts{2});
end
else
fprintf('folder "%s" does not exist in current directory!\n', parts{1});
end

Accedi per commentare.

Risposte (1)

Neeraj
Neeraj il 22 Mag 2023
Hello,
The error clearly states that 'imageDatastore' is unable to find the files/folders located at location 'recycle101\project\aluminiumcan'
Please ensure that the relative path: 'recycle101\project\aluminiumcan' exists.
If it does exist, then try to pass the absolute path to the 'imageDatastore' which might look similar to: 'C:\Users\OneDrive\Desktop\recycle101\project\aluminiumcan'
If the absolute path works without any error, then you only need to modify the 'outputFolder' variable as shown below:
clc
clear all; close all;
outputFolder=fullfile('C:\Users\OneDrive\Desktop\recycle101');
rootFolder=fullfile(outputFolder,'project');
categories={'aluminiumcan','petbottles','drinkcartonbox'};
imds=imageDatastore(fullfile(rootFolder,categories),'LabelSource','foldernames');
tbl=countEachLabel(imds)

Categorie

Scopri di più su File Operations in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by