I am trying understand the code for stop sign detector using cnn but i do no identify the "Command" in below sentencie of the program: "helperCIFAR10Data.download(url,cifar10Data); I look for help but it shows an error msg

댓글 수: 9

douadi alim
douadi alim 2016년 11월 10일
Hello, I had the same issue for using this class "helperCIFAR10Data" on Matlab R2015b. After trying [fullfile(toolboxdir('vision'),'visiondemos','helperCIFAR10Data.m'] I found may other classes in Matlab root but not that one. So if you found any solution, please help.
Walter Roberson
Walter Roberson 2016년 11월 10일
That code requires R2016b or later.
Vrushal
Vrushal 2017년 9월 21일
편집: Vrushal 2017년 9월 21일
I have R2015a and wrote this code:
It's showing too many output arguments.I need to extract trainingimages,traininglabels,etc. Help me with it.
Your S is a structure array of loaded data. You should be extracting fields from it, not trying to load() it. For example, if each .mat file has a variable named "trainingImages" then
trainingImages = cat(4, S.trainingImages);
Vrushal
Vrushal 2017년 9월 22일
편집: Vrushal 2017년 9월 22일
It's showing error of reference to non-existent field "trainingImages" but in R2017a they were able to extract each label by using:
[trainingImages, trainingLabels, testImages, testLabels] = helperCIFAR10Data.load(cifar10Data);
I need to do same in R2015a...please help me with it
Vrushal
Vrushal 2017년 9월 23일
@walter robinson
Please show the output of
whos -file data_batch_1.mat
whos -file data_batch_2.mat
whos -file data_batch_3.mat
whos -file data_batch_4.mat
whos -file data_batch_5.mat
Jun Zhang
Jun Zhang 2019년 3월 18일
I have the same problem.
>> whos -file data_batch_1.mat
whos -file data_batch_2.mat
whos -file data_batch_3.mat
whos -file data_batch_4.mat
whos -file data_batch_5.mat
Name Size Bytes Class Attributes
batch_label 1x21 42 char
data 10000x3072 30720000 uint8
labels 10000x1 10000 uint8
Name Size Bytes Class Attributes
batch_label 1x21 42 char
data 10000x3072 30720000 uint8
labels 10000x1 10000 uint8
Name Size Bytes Class Attributes
batch_label 1x21 42 char
data 10000x3072 30720000 uint8
labels 10000x1 10000 uint8
Name Size Bytes Class Attributes
batch_label 1x21 42 char
data 10000x3072 30720000 uint8
labels 10000x1 10000 uint8
Name Size Bytes Class Attributes
batch_label 1x21 42 char
data 10000x3072 30720000 uint8
labels 10000x1 10000 uint8
Walter Roberson
Walter Roberson 2019년 3월 18일
Could you clarify what problem you are having? Please post your code.

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2016년 11월 8일

0 개 추천

That code requires R2016b or later.

댓글 수: 8

Euseb Martinez
Euseb Martinez 2016년 11월 8일
Yes Sir Tks! I did the download from Matlab trial (I assume is the most updated version) even I did all row comment (% sign in the beginning of the sentence) and the code runs with no error msg! That's the reason of my question, I do not understand what this sentence means or what it doing in the code sequence.
type(fullfile(toolboxdir('vision'),'visiondemos','helperCIFAR10Data.m'))
% This is helper class to download and import the CIFAR-10 dataset. The
% dataset is downloaded from:
%
% https://www.cs.toronto.edu/~kriz/cifar-10-matlab.tar.gz
%
% References
% ----------
% Krizhevsky, Alex, and Geoffrey Hinton. "Learning multiple layers of
% features from tiny images." (2009).
Euseb Martinez
Euseb Martinez 2016년 11월 9일
편집: Euseb Martinez 2016년 11월 9일
Tks so much Sir!.... now I know the meaning of sentence. I will try to understand the complete code. Tks again. Euseb
ahmed SHAH
ahmed SHAH 2016년 11월 17일
편집: Walter Roberson 2016년 11월 17일
when i resolve the above issure using
fullfile( fullfile('C:\Users\hexroot\Desktop\people detection\cifar-10-matlab\cifar-10-batches-mat'))
its creates are ans named variable in workspace...... when i execute the second line
[trainingImages, trainingLabels, testImages, testLabels] = helperCIFAR10Data.load(cifar-10-batches-mat);
its show an error undefined variable cifar.. and can i use this example to detect cars and people also thanks in advance and what database will be good for detecting car people and stop signs..
ahmed SHAH
ahmed SHAH 2016년 11월 17일
@walter robinson
location = 'C:\Users\hexroot\Desktop\people detection\cifar-10-matlab';
[trainingImages, trainingLabels, testImages, testLabels] = helperCIFAR10Data.load(location);
Swati Prakash
Swati Prakash 2020년 8월 11일
I have installed MATLAB 2020 but also it is giving error
Unable to resolve the name helperCIFAR10Data.load.
I have given the fullpath
addpath(['D','/examples','/deeplearning_shared','/main']);
location = 'D:\examples\deeplearning_shared\main\helperCIFAR10Data.m';
[trainingImages, trainingLabels, testImages, testLabels] = helperCIFAR10Data.load(location);
These days,
fullfile(matlabroot,'examples','deeplearning_shared','main', 'helperCIFAR10Data.m')

댓글을 달려면 로그인하십시오.

추가 답변 (5개)

Vignesh Ganapathiraman
Vignesh Ganapathiraman 2018년 5월 7일

2 개 추천

Or you can just add the path at the start
addpath([matlabroot,'/examples','/vision','/main']);

댓글 수: 1

Zekun
Zekun 2019년 4월 20일
Great! This solved my problem!~ Thanks!

댓글을 달려면 로그인하십시오.

Ali
Ali 2017년 11월 1일
편집: Walter Roberson 2017년 11월 1일

1 개 추천

Hi guys,
The file is really at the directory provided by Walter Roberson, however the error message still there.
to overcome this problem, you may follow these steps:
  1. go to fullfile(matlabroot,'examples', 'vision', 'main', helperCIFAR10Data.m', find the file there and open it.
  2. inside 'helperCIFAR10Data.m' you will find 4 functions (download,load, loadBatchAsFourDimensionalArray, convertLabelsToCategorical). Copy each function to a new script and save them. you can give 'load' function to another name to avoid conflict with the same Matlab-builtin function.
  3. use the code provided on Mathworks website but remove the prefix'helperCIFAR10Data'
% Download CIFAR-10 data to a temporary directory
location = 'C:\Users\JICA\Desktop\Object Detection Using Deep Learning\';
url = 'https://www.cs.toronto.edu/~kriz/cifar-10-matlab.tar.gz';
download(url, location);
%%Load
% Load the CIFAR-10 training and test data.
[trainingImages, trainingLabels, testImages, testLabels] = Dataloading(location);
Each image is a 32x32 RGB image and there are 50,000 training samples.
size(trainingImages)
hope this helps
Ali

댓글 수: 5

sheeza rafaqat
sheeza rafaqat 2018년 2월 18일
how can i goto fullfile(matlabroot,'examples', 'vision', 'main', helperCIFAR10Data')
cd(fullfile(matlabroot,'examples', 'vision', 'main'))
edit helperCIFAR10Data.m
sheeza rafaqat
sheeza rafaqat 2018년 2월 28일
when i am copying each function in a seperate script it is giving an error of "Not enough arguments in function". how can i resolve this issue?
bhanu prakash
bhanu prakash 2019년 3월 5일
when i am copying each function in a seperate script it is giving an error of "Not enough arguments in function". how can i resolve this issue?
Walter Roberson
Walter Roberson 2019년 3월 5일
Please show which function you are calling, and show how you are calling it.
Did you follow Ali's suggestion to rename load ? That would include changing the references to the function so that you do not accidentally invoke MATLAB's built-in load()

댓글을 달려면 로그인하십시오.

巴山学长
巴山学长 2017년 11월 2일

1 개 추천

Just copy the 'helperCIFAR10Data.m' to your temporary directory, and then run. Good luck!
Saif Hussein
Saif Hussein 2017년 9월 28일
편집: Walter Roberson 2017년 10월 19일

0 개 추천

Undefined variable "helperCIFAR10Data" or class "helperCIFAR10Data.load".
l have email the matlab team many times, they didn't solve the problem. l do believe the problem with matlab copy under Mac,

댓글 수: 3

Walter Roberson
Walter Roberson 2017년 9월 28일
Which MATLAB release are you using?
Donnie Agema
Donnie Agema 2017년 10월 14일
I am using MATLAB version R2017b and getting the same error. Any solution?
Walter Roberson
Walter Roberson 2017년 10월 19일
편집: Walter Roberson 2019년 1월 30일
In R2017b I find it at
fullfile(matlabroot,'examples', 'vision', 'main', 'helperCIFAR10Data.m')
This requires the Computer Vision toolbox.

댓글을 달려면 로그인하십시오.

Nicola Gaburro
Nicola Gaburro 2017년 10월 2일

0 개 추천

I'm having the same issue with Matlab R2017b When running the command
helperCIFAR10Data.download(url, cifar10Data);
it shows the error
Undefined variable "helperCIFAR10Data" or class "helperCIFAR10Data.download". Seems like helperCIFAR10Data class is missing

댓글 수: 6

Walter Roberson
Walter Roberson 2017년 10월 19일
편집: Walter Roberson 2019년 1월 30일
In R2017b I find it at
fullfile(matlabroot,'examples', 'vision', 'main', 'helperCIFAR10Data.m')
This requires the Computer Vision toolbox.
By R2018b it has moved to
fullfile(matlabroot,'examples', 'nnet', 'main', 'helperCIFAR10Data.m')
Dora Craba
Dora Craba 2020년 5월 15일
what is the correct code for matlab2019b?
fullfile(matlabroot,'examples','deeplearning_shared','main','helperCIFAR10Data.m')
Dora Craba
Dora Craba 2020년 5월 16일
Thank you for your answer. Now I get another error:
Unable to resolve the name helperCIFAR10Data.load.
Error in prova_dataset (line 9)
[trainingImages,trainingLabels,testImages,testLabels] = helperCIFAR10Data.load(cifar10Data);
The helperCIFAR10Data class must be on your MATLAB path.
addpath(fullfile(matlabroot,'examples','deeplearning_shared','main'))

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by