Why do I receive this error message?

Hello.
I tried to run the code via this link https://github.com/yifanw90/Zeyde_superes and I get errors below, can anyone help resolve this.
% Training [0 x 1000] dictionary on 0 vectors using K-SVD
Error using ksvd (line 386)
Number of training signals is smaller than number of atoms to train
Error in learn_dict (line 49)
[conf.dict_lores, gamma] = ksvd(ksvd_conf); % , '');
Error in Example (line 25)
conf = learn_dict(conf, load_images(...
>>

18 comentarios

Walter Roberson
Walter Roberson el 10 de Nov. de 2018
Your data is empty.
Chidiebere Ike
Chidiebere Ike el 10 de Nov. de 2018
Editada: Walter Roberson el 10 de Nov. de 2018
Thanks Walter for your response. I observed that too. I entered some images in Data (Test and Training) and still got errors below. I have attached a link for the same file with images in Data. What could be the reason for this error? Please guide me.
Training [0 x 1000] dictionary on 0 vectors using K-SVD
Error using ksvd (line 386)
Number of training signals is smaller than number of atoms to train
Error in learn_dict (line 49)
[conf.dict_lores, gamma] = ksvd(ksvd_conf); % , '');
Error in Example (line 25)
conf = learn_dict(conf, load_images(...
Thank you
The code uses MS Windows folder separator. I had to change from \ to / to get it to work on my Mac.
conf = learn_dict(conf, load_images(...
glob('./CVPR08-SR/Data/Training', '*.bmp') ...
));
I also had to change the addpath to
addpath(fullfile(p, 'ksvdbox')); % K-SVD dictionary training algorithm
addpath(fullfile(p, 'ompbox')); % Orthogonal Matching Pursuit algorithm
Thanks Walter. I made all corrections as instructed and still got the errors stated below. I ran exactly the same Drive code I sent earlier. This is what I did:
if true
% p = pwd;
addpath(fullfile(p, 'ksvdbox')); % K-SVD dictionary training algorithm
addpath(fullfile(p, 'ompbox')); % Orthogonal Matching Pursuit algorithm
% addpath(fullfile(p, '../CVPR08-SR'));
mat_file = 'conf.mat';
%%Simulation settings
conf.scale = 3; % scale-up factor
conf.level = 1; % # of scale-ups to perform
conf.window = [3 3]; % low-res. window size
conf.border = [1 1]; % border of the image (to ignore)
% High-pass filters for feature extraction (defined for upsampled low-res.)
conf.upsample_factor = 3; % upsample low-res. into mid-res.
O = zeros(1, conf.upsample_factor-1);
G = [1 O -1]; % Gradient
L = [1 O -2 O 1]/2; % Laplacian
conf.filters = {G, G.', L, L.'}; % 2D versions
conf.interpolate_kernel = 'bicubic';
conf.overlap = [1 1]; % partial overlap (for faster training)
conf = learn_dict(conf, load_images(...
glob('./CVPR08-SR/Data/Training', '*.bmp')));
conf.overlap = conf.window - [1 1]; % full overlap scheme (for better reconstruction)
save(mat_file, 'conf');
end
This is the error I got:
if true
% code>> clear all
>> Example
Training [30 x 1000] dictionary on 104788 vectors using K-SVD
Attempt to execute SCRIPT ompmex as a function:
/Users/ikechidiebere/Downloads/Zeyde_superes-master/ompbox/private/ompmex.m
Error in omp (line 162)
gamma = ompmex(D,X,DtX,G,T,sparse_gamma,msgdelta,profile);
Error in ksvd>sparsecode (line 562)
Gamma = ompfunc(D,data,G,thresh,ompparams{:});
Error in ksvd (line 436)
Gamma = sparsecode(data,D,XtX,G,thresh);
Error in learn_dict (line 49)
[conf.dict_lores, gamma] = ksvd(ksvd_conf); % , '');
Error in Example (line 25)
conf = learn_dict(conf, load_images(...
>> end
What could be the reason for this?
Thank you
Walter Roberson
Walter Roberson el 10 de Nov. de 2018
Editada: Walter Roberson el 10 de Nov. de 2018
here = pwd;
cd /Users/ikechidiebere/Downloads/Zeyde_superes-master/ompbox/private
make
cd /Users/ikechidiebere/Downloads/Zeyde_superes-master/ksvdbox/private
make
cd(here);
Example
Chidiebere Ike
Chidiebere Ike el 10 de Nov. de 2018
Thanks for your response. I am sorry I don't understand your message sir. Can you please make it clear. Thanks
Walter Roberson
Walter Roberson el 10 de Nov. de 2018
That is a sequence of commands you should execute.
The problem you have is that ompbox and ksvdbox have code that needs to be compiled; you have to cd to the appropriate directory and use the command "make" to compile the code.
Chidiebere Ike
Chidiebere Ike el 11 de Nov. de 2018
Editada: Chidiebere Ike el 11 de Nov. de 2018
I got this error.
if true
% >> here = pwd;
>> cd /Users/ikechidiebere/Downloads/Zeyde_superes-master/ompbox/private
>> make
Compiling ompmex...
Warning: Xcode appears to be installed, but it has not been configured. Run "osascript -e 'do
shell script "xcode-select -switch /Applications/Xcode.app" with administrator privileges'" to
configure Xcode. You must be an administrator of this computer to complete this action.
> In make (line 37)
Error using mex
No supported compiler or SDK was found. For options, visit
https://www.mathworks.com/support/compilers.
Error in make (line 37)
mex('ompmex.c', ompsources{:},compile_params{:});
0:92: execution error: xcode-select: error: invalid developer directory '/Applications/Xcode.app' (1)
ans =
1
>> cd /Users/ikechidiebere/Downloads/Zeyde_superes-master/ksvdbox/private
>> make
Compiling addtocols.c...
Warning: Xcode appears to be installed, but it has not been configured. Run "osascript -e 'do
shell script "xcode-select -switch /Applications/Xcode.app" with administrator privileges'" to
configure Xcode. You must be an administrator of this computer to complete this action.
> In make (line 39)
Error using mex
No supported compiler or SDK was found. For options, visit
https://www.mathworks.com/support/compilers.
Error in make (line 39)
mex(sourcefiles{i}{:},compile_params{:});
0:92: execution error: xcode-select: error: invalid developer directory '/Applications/Xcode.app' (1)
ans =
1
>> cd(here);
>> Example
Warning: Name is nonexistent or not a directory:
/Users/ikechidiebere/Downloads/Zeyde_superes-master/ompbox/private/ksvdbox
> In path (line 109)
In addpath (line 94)
In Example (line 5)
Warning: Name is nonexistent or not a directory:
/Users/ikechidiebere/Downloads/Zeyde_superes-master/ompbox/private/ompbox
> In path (line 109)
In addpath (line 94)
In Example (line 6)
Training [0 x 1000] dictionary on 0 vectors using K-SVD
Error using ksvd (line 386)
Number of training signals is smaller than number of atoms to train
Error in learn_dict (line 49)
[conf.dict_lores, gamma] = ksvd(ksvd_conf); % , '');
Error in Example (line 25)
conf = learn_dict(conf, load_images(...
>>
end
What could be the issue here? Please guide me
Thanks
Chidiebere Ike
Chidiebere Ike el 11 de Nov. de 2018
Editada: Chidiebere Ike el 11 de Nov. de 2018
I am using macOS Mojave, version 10.14.1 and my version of Matlab is Matlab_R2017b
Walter Roberson
Walter Roberson el 11 de Nov. de 2018
Which MacOS are you using?
Chidiebere Ike
Chidiebere Ike el 11 de Nov. de 2018
Editada: Chidiebere Ike el 11 de Nov. de 2018
macOS Mojave, version 10.14.1
Walter Roberson
Walter Roberson el 11 de Nov. de 2018
That version of MATLAB did not support that operating system.
Chidiebere Ike
Chidiebere Ike el 11 de Nov. de 2018
Please, which of these version of Matlab supports my operating system?
MATLAB 9.4(R2018a) or MATLAB 9.5(R2018b)
Thanks
madhan ravi
madhan ravi el 11 de Nov. de 2018
Editada: madhan ravi el 11 de Nov. de 2018
Chidiebere Ike
Chidiebere Ike el 11 de Nov. de 2018
Editada: Chidiebere Ike el 11 de Nov. de 2018
I have successfully compiled the ompbox and ksvdbox on 2017b Matlab version using Xcode 10 (new release). I still have errors stated below:
if true
% >> Error using imwrite (line 467)
Unable to open file "Set5/results/baby_GT[1-Original].bmp" for writing. You might not
have write permission.
Error in Example (line 57)
imwrite(result(:, :, j), conf.results{i}{j});
>>
end
madhan ravi
madhan ravi el 11 de Nov. de 2018
Unable to open file "Set5/results/baby_GT[1-Original].bmp" for writing. You might not have write permission .
Walter Roberson
Walter Roberson el 11 de Nov. de 2018
Directory Set5 or Set5/results might not exist relative to the directory of execution, or directory Set5/results might be one you do not have permission to write into.
Chidiebere Ike
Chidiebere Ike el 11 de Nov. de 2018
Solved. Thanks so much. I appreciate

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 10 de Nov. de 2018

Comentada:

el 11 de Nov. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by