我已经通过提供的代码 cnn_mnist 训练了一个 cnn。之后,我尝试对图像进行分类,但我不明白在以下代码之后出现此错误的原因:
[net, info] = cnn_mnist
net =
layers: {1x8 cell}
info =
train: [1x1 struct]
val: [1x1 struct]
f=fopen(fullfile('.\data\mnist\', 't10k-images-idx3-ubyte'),'r') ;
x2=fread(f,inf,'uint8');
fclose(f) ;
x2=permute(reshape(x2(17:end),28,28,10e3),[2 1 3]) ;
im = x2(:,:,1);
im = single(im);
res = vl_simplenn(net,im);
Reference to non-existent field 'class'.
Error in vl_simplenn (line 163)
res(i+1).x = vl_nnsoftmaxloss(res(i).x, l.class) ;