Why do I receive this error message?
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
Chidiebere Ike
2018-11-10
编辑:Walter Roberson
2018-11-10
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
Walter Roberson
2018-11-10
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
Chidiebere Ike
2018-11-10
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
2018-11-10
编辑:Walter Roberson
2018-11-10
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
2018-11-10
Thanks for your response. I am sorry I don't understand your message sir. Can you please make it clear. Thanks
Walter Roberson
2018-11-10
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
2018-11-11
编辑:Chidiebere Ike
2018-11-11
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
2018-11-11
编辑:Chidiebere Ike
2018-11-11
I am using macOS Mojave, version 10.14.1 and my version of Matlab is Matlab_R2017b
Chidiebere Ike
2018-11-11
Please, which of these version of Matlab supports my operating system?
MATLAB 9.4(R2018a) or MATLAB 9.5(R2018b)
Thanks
Chidiebere Ike
2018-11-11
编辑:Chidiebere Ike
2018-11-11
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
2018-11-11
Unable to open file "Set5/results/baby_GT[1-Original].bmp" for writing. You might not have write permission .
Walter Roberson
2018-11-11
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.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!发生错误
由于页面发生更改,无法完成操作。请重新加载页面以查看其更新后的状态。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
亚太
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)