我已经训练了一个卷积神经网络(CNN),其中包含我在二进制文件中的以下数据(标签,文件名,数据(像素)):
[array([2, 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2, 1,
0, 2, 1, 0, 2, 1, 0]), array(['10_c.jpg', '10_m.jpg', '10_n.jpg', '1_c.jpg',
'1_m.jpg', '1_n.jpg', '2_c.jpg', '2_m.jpg',
'2_n.jpg', '3_c.jpg', '3_m.jpg', '3_n.jpg',
'4_c.jpg', '4_m.jpg', '4_n.jpg', '5_c.jpg',
'5_m.jpg', '5_n.jpg', '6_c.jpg', '6_m.jpg',
'6_n.jpg', '7_c.jpg', '7_m.jpg', '7_n.jpg',
'8_c.jpg', '8_m.jpg', '8_n.jpg', '9_c.jpg',
'9_m.jpg', '9_n.jpg'],
dtype='
[136, 137, 138, ..., 114, 110, 111],
[200, 200, 199, ..., 179, 178, 177],
...,
[146, 157, 165, ..., 202, 202, 201],
[228, 225, 222, ..., 219, 221, 223],
[128, 127, 127, ..., 133, 129, 127]])]
每批包含所有图像,并运行30个epohs:
EPOCH 0
0 0.476923
DONE WITH EPOCH
EPOCH 1
0 0.615385
DONE WITH EPOCH
EPOCH 2
0 0.615385
DONE WITH EPOCH
EPOCH 3
0 0.538462
DONE WITH EPOCH
EPOCH 4
0 0.384615
DONE WITH EPOCH
...
...
EPOCH 28
0 0.615385
DONE WITH EPOCH
EPOCH 29
0 0.692308
DONE WITH EPOCH
我的问题是我想尝试新的图像(测试),并想知道返回的类(0,1,2) . 在这种情况下我该怎么办?换句话说,我训练了CNN,但是如何测试呢?
EDIT-1
对于 Evaluating accuracy 点,测试20张图像时得到以下结果:
EPOCH 0
0 1.0
DONE WITH EPOCH
EPOCH 1
0 1.0
DONE WITH EPOCH
EPOCH 2
0 1.0
DONE WITH EPOCH
EPOCH 3
0 1.0
DONE WITH EPOCH
EPOCH 4
0 1.0
DONE WITH EPOCH
EPOCH 5
0 1.0
DONE WITH EPOCH
EPOCH 6
0 1.0
DONE WITH EPOCH
EPOCH 7
0 1.0
DONE WITH EPOCH
EPOCH 8
0 1.0
DONE WITH EPOCH
EPOCH 9
0 1.0
DONE WITH EPOCH
EPOCH 10
0 1.0
DONE WITH EPOCH
EPOCH 11
0 1.0
DONE WITH EPOCH
EPOCH 12
0 1.0
DONE WITH EPOCH
EPOCH 13
0 1.0
DONE WITH EPOCH
EPOCH 14
0 1.0
DONE WITH EPOCH
EPOCH 15
0 1.0
DONE WITH EPOCH
EPOCH 16
0 1.0
DONE WITH EPOCH
EPOCH 17
0 1.0
DONE WITH EPOCH
EPOCH 18
0 1.0
DONE WITH EPOCH
EPOCH 19
0 1.0
DONE WITH EPOCH
EPOCH 20
0 1.0
DONE WITH EPOCH
EPOCH 21
0 1.0
DONE WITH EPOCH
EPOCH 22
0 1.0
DONE WITH EPOCH
EPOCH 23
0 1.0
DONE WITH EPOCH
EPOCH 24
0 1.0
DONE WITH EPOCH
EPOCH 25
0 1.0
DONE WITH EPOCH
EPOCH 26
0 1.0
DONE WITH EPOCH
EPOCH 27
0 1.0
DONE WITH EPOCH
EPOCH 28
0 1.0
DONE WITH EPOCH
EPOCH 29
0 1.0
DONE WITH EPOCH
在应用 Getting the labels that the network produced for test data 点时,我得到以下内容:
EPOCH 0
0 0.0
DONE WITH EPOCH
EPOCH 1
0 0.0
DONE WITH EPOCH
EPOCH 2
0 0.0
DONE WITH EPOCH
EPOCH 3
0 0.0
DONE WITH EPOCH
EPOCH 4
0 0.0
DONE WITH EPOCH
EPOCH 5
0 0.0
DONE WITH EPOCH
EPOCH 6
0 0.0
DONE WITH EPOCH
EPOCH 7
0 0.0
DONE WITH EPOCH
EPOCH 8
0 0.0
DONE WITH EPOCH
EPOCH 9
0 0.0
DONE WITH EPOCH
EPOCH 10
0 0.0
DONE WITH EPOCH
EPOCH 11
0 0.0
DONE WITH EPOCH
EPOCH 12
0 0.0
DONE WITH EPOCH
EPOCH 13
0 0.0
DONE WITH EPOCH
EPOCH 14
0 0.0
DONE WITH EPOCH
EPOCH 15
0 0.0
DONE WITH EPOCH
EPOCH 16
0 0.0
DONE WITH EPOCH
EPOCH 17
0 0.0
DONE WITH EPOCH
EPOCH 18
0 0.0
DONE WITH EPOCH
EPOCH 19
0 0.0
DONE WITH EPOCH
EPOCH 20
0 0.0
DONE WITH EPOCH
EPOCH 21
0 0.0
DONE WITH EPOCH
EPOCH 22
0 0.0
DONE WITH EPOCH
EPOCH 23
0 0.0
DONE WITH EPOCH
EPOCH 24
0 0.0
DONE WITH EPOCH
EPOCH 25
0 0.0
DONE WITH EPOCH
EPOCH 26
0 0.0
DONE WITH EPOCH
EPOCH 27
0 0.0
DONE WITH EPOCH
EPOCH 28
0 0.0
DONE WITH EPOCH
EPOCH 29
0 0.0
DONE WITH EPOCH
为什么我得到 0 或 1 ?这些值是否有意义(即没有分数)?
EDIT-2
对于 Getting the labels that the network produced for test data ,当打印出标签值和每个纪元的准确性时,我得到以下(标签总是 0 ,虽然我只期待 0 或 2 ,精确度为 1 ):
EPOCH 0
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 1.0
DONE WITH EPOCH
EPOCH 1
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 1.0
DONE WITH EPOCH
EPOCH 2
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 1.0
DONE WITH EPOCH
EPOCH 3
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 1.0
DONE WITH EPOCH
EPOCH 4
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 1.0
DONE WITH EPOCH
EPOCH 5
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 1.0
DONE WITH EPOCH
.....
.....
EPOCH 28
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 1.0
DONE WITH EPOCH
EPOCH 29
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 1.0
DONE WITH EPOCH
谢谢 .