1

我正在尝试使用vInputsvTargets创建模型来训练我的神经网络net
但是无论我尝试在我的代码中纠正什么,我都会不断收到这个恼人的错误:

错误: 使用零时出错。超出了程序允许的最大变量大小。


我没有找到任何由我的代码创建的大数据,而且我有 4GB 的 RAM

我有 230 张图像,我需要将它们分为 3 个部分'Sedan', 'SUV', 'Hatchback'

image size [15x26]

我使用此代码将提取的单个图像的特征转换gabor filterFeature Vector

function IMVECTOR = im2vec (img)
load Gabor;
img = adapthisteq(img); 
Features75x208 = cell(5,8);
for s = 1:5
    for j = 1:8
        Features75x208{s,j} = mminmax(abs(ifft2(G{s,j}.*fft2(double(img),32,32),15,26)));
    end
end
Features25x70 = cell2mat(Features75x208);
Features25x70 (3:3:end,:)=[];
Features25x70 (2:2:end,:)=[];
Features25x70 (:,3:3:end)=[];
Features25x70 (:,2:2:end)=[];
IMVECTOR = reshape (Features25x70,[1750 1]);


现在,在创建特征向量后,我vInputs对 230 个图像使用相同的函数。因此我得到了 1. vInputs=[1750x230].
2.vTargets=[4x230].

但是每当我运行时,Project我都会在function.

function net = create_pr_net(inputs,targets)
%CREATE_PR_NET Creates and trains a pattern recognition neural network.
% Create Network
numHiddenNeurons = 35;  
net = newpr(inputs,targets,numHiddenNeurons);
net.divideParam.trainRatio = 70/100;  
net.divideParam.valRatio = 15/100;  
net.divideParam.testRatio = 15/100; 
% Train and Apply Network
[net,tr] = train(net,inputs,targets);% <== ERROR OCCURS HERE<==
outputs = sim(net,inputs);
% Plot
plotperf(tr);
plotconfusion(targets,outputs);
save net net


这是完整的错误:

Error using zeros
Maximum variable size allowed by the program is exceeded.

Error in nnMex2.codeHints (line 117)
hints.TEMP =
zeros(1,ceil(tempSize/8),'double');

Error in nncalc.setup2 (line 13)
  calcHints = calcMode.codeHints(calcHints);

Error in network/train (line 306)
  [calcLib,calcNet] = nncalc.setup2(calcMode,calcNet,calcData,calcHints);

Error in create_pr_net (line 14)
[net,tr] = train(net,inputs,targets);

Error in executeMe (line 22)
  net=create_pr_net(vInputs,vTargets);


请帮助我并询问我是否遗漏了任何内容并需要指定更多详细信息。

的价值tempSize

临时尺寸

编辑:嗯,我想通了,因为我使用的是 32 位系统,所以我一次最多可以处理
2^32 = 4.294967e+09
如果我使用 64 位,我可以
2^64 = 9.22337e+18一次处理地址。
那么你们能给我一些关于如何让它在我的系统上工作的想法吗?

4

0 回答 0