黑暗:训练自定义对象后没有创建权重

2024-09-28 01:29:56 发布

您现在位置:Python中文网/ 问答频道 /正文

darknet训练司令部不产生任何输出,过早退出(与其他CNN训练项目相比)

尤洛-目标cfg相应配置。
这个达克内特.exe已使用MSVS2017成功编译和构建。在

我有3个新的自定义类:

在目标数据文件:

classes= 3  
train = data/train.txt  
valid = data/train.txt  
names = data/obj.names  
backup = backup/  

在目标名称文件:

^{pr2}$

我为每个类运行了大约500幅图像的yolo_标记,生成了相应的*.txt文件。
我把所有的jpg和txt文件放在obj目录中。
这个火车.txt文件包含*.jpg文件的路径,例如:“data/obj/neuch013311.jpg”

下载了darknet53.conv.74文件并将其放在“x64”目录中

以管理员身份运行命令(从虚拟机,因此没有GPU):

C:\Users\claw\Downloads\darknet-master\darknet-master\build\darknet\x64>darknet_no_gpu.exe detector train data/obj.data yolo-obj.cfg darknet53.conv.74
yolo-obj

命令行输出:

layer filters size input output  
0 conv 32 3 x 3 / 1 416 x 416 x 3 -> 416 x 416 x 32 0.299 BF  
1 conv 64 3 x 3 / 2 416 x 416 x 32 -> 208 x 208 x 64 1.595 BF  
2 conv 32 1 x 1 / 1 208 x 208 x 64 -> 208 x 208 x 32 0.177 BF  
3 conv 64 3 x 3 / 1 208 x 208 x 32 -> 208 x 208 x 64 1.595 BF  
4 Shortcut Layer: 1  
5 conv 128 3 x 3 / 2 208 x 208 x 64 -> 104 x 104 x 128 1.595 BF  
6 conv 64 1 x 1 / 1 104 x 104 x 128 -> 104 x 104 x 64 0.177 BF  
7 conv 128 3 x 3 / 1 104 x 104 x 64 -> 104 x 104 x 128 1.595 BF  
8 Shortcut Layer: 5  
9 conv 64 1 x 1 / 1 104 x 104 x 128 -> 104 x 104 x 64 0.177 BF  
10 conv 128 3 x 3 / 1 104 x 104 x 64 -> 104 x 104 x 128 1.595 BF  
11 Shortcut Layer: 8  
12 conv 256 3 x 3 / 2 104 x 104 x 128 -> 52 x 52 x 256 1.595 BF  
13 conv 128 1 x 1 / 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF  
14 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF  
15 Shortcut Layer: 12  
16 conv 128 1 x 1 / 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF  
17 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF  
18 Shortcut Layer: 15  
19 conv 128 1 x 1 / 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF  
20 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF  
21 Shortcut Layer: 18  
22 conv 128 1 x 1 / 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF  
23 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF  
24 Shortcut Layer: 21  
25 conv 128 1 x 1 / 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF  
26 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF  
27 Shortcut Layer: 24  
28 conv 128 1 x 1 / 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF  
29 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF  
30 Shortcut Layer: 27  
31 conv 128 1 x 1 / 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF  
32 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF  
33 Shortcut Layer: 30  
34 conv 128 1 x 1 / 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF  
35 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF  
36 Shortcut Layer: 33  
37 conv 512 3 x 3 / 2 52 x 52 x 256 -> 26 x 26 x 512 1.595 BF  
38 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF  
39 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF  
40 Shortcut Layer: 37  
41 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF  
42 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF  
43 Shortcut Layer: 40  
44 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF  
45 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF  
46 Shortcut Layer: 43  
47 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF  
48 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF  
49 Shortcut Layer: 46  
50 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF  
51 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF  
52 Shortcut Layer: 49  
53 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF  
54 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF  
55 Shortcut Layer: 52  
56 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF  
57 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF  
58 Shortcut Layer: 55  
59 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF  
60 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF  
61 Shortcut Layer: 58  
62 conv 1024 3 x 3 / 2 26 x 26 x 512 -> 13 x 13 x1024 1.595 BF  
63 conv 512 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BF  
64 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BF  
65 Shortcut Layer: 62  
66 conv 512 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BF  
67 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BF  
68 Shortcut Layer: 65  
69 conv 512 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BF  
70 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BF  
71 Shortcut Layer: 68  
72 conv 512 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BF  
73 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BF  
74 Shortcut Layer: 71  
75 conv 512 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BF  
76 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BF  
77 conv 512 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BF  
78 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BF  
79 conv 512 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BF  
80 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BF  
81 conv 24 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 24 0.008 BF  
82 yolo  
83 route 79  
84 conv 256 1 x 1 / 1 13 x 13 x 512 -> 13 x 13 x 256 0.044 BF  
85 upsample 2x 13 x 13 x 256 -> 26 x 26 x 256  
86 route 85 61  
87 conv 256 1 x 1 / 1 26 x 26 x 768 -> 26 x 26 x 256 0.266 BF  
88 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF  
89 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF  
90 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF  
91 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF  
92 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF  
93 conv 24 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 24 0.017 BF  
94 yolo  
95 route 91  
96 conv 128 1 x 1 / 1 26 x 26 x 256 -> 26 x 26 x 128 0.044 BF  
97 upsample 2x 26 x 26 x 128 -> 52 x 52 x 128  
98 route 97 36  
99 conv 128 1 x 1 / 1 52 x 52 x 384 -> 52 x 52 x 128 0.266 BF  
100 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF  
101 conv 128 1 x 1 / 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF  
102 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF  
103 conv 128 1 x 1 / 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF  
104 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF  
105 conv 24 1 x 1 / 1 52 x 52 x 256 -> 52 x 52 x 24 0.033 BF  
106 yolo  

Total BFLOPS 65.304  
Loading weights from darknet53.conv.74...  
seen 64  
Done!  

Learning Rate: 0.001, Momentum: 0.9, Decay: 0.0005  
If error occurs - run training with flag: -dont_show  
Resizing  
416 x 416  

Cannot load image "data/img/ring chic-criss-cross-adjustable-ad-ring.jpg"  
Loaded: 1.143984 seconds  
Used AVX  
Region 82 Avg IOU: 0.333570, Class: 0.602019, Obj: 0.402860, No Obj: 0.528741, .5R: 0.000000, .75R: 0.000000, count: 4  
Region 94 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.521660, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 106 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.514523, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 82 Avg IOU: 0.329878, Class: 0.570290, Obj: 0.611294, No Obj: 0.528309, .5R: 0.250000, .75R: 0.000000, count: 4  
Region 94 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.521499, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 106 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.514392, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 82 Avg IOU: 0.575794, Class: 0.539979, Obj: 0.316475, No Obj: 0.528604, .5R: 0.500000, .75R: 0.500000, count: 2  
Region 94 Avg IOU: 0.312451, Class: 0.125449, Obj: 0.238739, No Obj: 0.521500, .5R: 0.000000, .75R: 0.000000, count: 1  
Region 106 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.514025, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 82 Avg IOU: 0.257590, Class: 0.547629, Obj: 0.447064, No Obj: 0.527685, .5R: 0.000000, .75R: 0.000000, count: 3  
Region 94 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.521665, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 106 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.515411, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 82 Avg IOU: 0.297573, Class: 0.436722, Obj: 0.389306, No Obj: 0.528302, .5R: 0.500000, .75R: 0.000000, count: 4  
Region 94 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.521452, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 106 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.513978, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 82 Avg IOU: 0.191856, Class: 0.645887, Obj: 0.364560, No Obj: 0.528137, .5R: 0.000000, .75R: 0.000000, count: 5  
Region 94 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.521575, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 106 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.514143, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 82 Avg IOU: 0.475039, Class: 0.419801, Obj: 0.578539, No Obj: 0.527876, .5R: 0.500000, .75R: 0.500000, count: 2  
Region 94 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.521085, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 106 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.514371, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 82 Avg IOU: 0.264798, Class: 0.416162, Obj: 0.462117, No Obj: 0.527412, .5R: 0.000000, .75R: 0.000000, count: 5  
Region 94 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.521446, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 106 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.514205, .5R: -nan(ind), .75R: -nan(ind), count: 0  


1: 1003.093994, 1003.093994 avg loss, 0.000000 rate, 1056.320056 seconds, 64 images  
Loaded: 0.000000 seconds  
Cannot load image "data/img/necklace 570239071_2906.jpg"  
Cannot load image "data/img/necklace 570239072_2906.jpg"  
Cannot load image "data/img/necklace 10019367_no_place_like_roam_necklace_green_main.jpg"  
Region 82 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.527527, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 94 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.521694, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 106 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.514430, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 82 Avg IOU: 0.213376, Class: 0.587271, Obj: 0.565966, No Obj: 0.528763, .5R: 0.000000, .75R: 0.000000, count: 5  
Region 94 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.522077, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 106 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.515318, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 82 Avg IOU: 0.314485, Class: 0.501796, Obj: 0.458959, No Obj: 0.528414, .5R: 0.000000, .75R: 0.000000, count: 2  
Region 94 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.521397, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 106 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.514781, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 82 Avg IOU: 0.278535, Class: 0.518696, Obj: 0.510300, No Obj: 0.528529, .5R: 0.000000, .75R: 0.000000, count: 5  
Region 94 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.521170, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 106 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.514448, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 82 Avg IOU: 0.270750, Class: 0.498121, Obj: 0.530221, No Obj: 0.528569, .5R: 0.000000, .75R: 0.000000, count: 2  
Region 94 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.521003, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 106 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.513312, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 82 Avg IOU: 0.235287, Class: 0.480098, Obj: 0.517194, No Obj: 0.527906, .5R: 0.000000, .75R: 0.000000, count: 4  
Region 94 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.521571, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 106 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.513103, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 82 Avg IOU: 0.368155, Class: 0.552764, Obj: 0.482865, No Obj: 0.528044, .5R: 0.200000, .75R: 0.000000, count: 5  
Region 94 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.521782, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 106 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.514365, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 82 Avg IOU: 0.393099, Class: 0.568679, Obj: 0.534074, No Obj: 0.528130, .5R: 0.000000, .75R: 0.000000, count: 2  
Region 94 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.522459, .5R: -nan(ind), .75R: -nan(ind), count: 0  
Region 106 Avg IOU: -nan(ind), Class: -nan(ind), Obj: -nan(ind), No Obj: 0.515186, .5R: -nan(ind), .75R: -nan(ind), count: 0  


2: 1002.576904, 1003.042297 avg loss, 0.000000 rate, 1043.121191 seconds, 128 images  
Loaded: 0.000000 seconds  

之后,我检查了备份目录,其中只创建了一个*.tmp文件(0 kb)
没有创建weight文件。。。在

我做错什么了?在


Tags: nolayerobjdatacountnanregionshortcut
3条回答

我认为你的训练集配置不正确。 你的大部分结果是-nan(ind)

您的火车.txt. 在

1:1003.093994,1003.093994平均丢失,0.000000速率,1056.320056秒,64幅图像 ^这是迭代次数。默认情况下,darknet在100次迭代后将权重写入备份文件夹。 如果你想要权重,在src中打开detector.c文件并修改

    if (i % 1000 == 0 || (i < 1000 && i % 3 == 0)) {
    //if (i % 100 == 0) {
    //if(i >= (iter_save + 100)) {

第204行就像我为我的代码所做的,如果你想在你的第一次迭代中有一个权重,就把数字1(而不是3)改为1 然后再造一次。在

尝试在一个较小的网络上进行培训,如本教程中所示:https://timebutt.github.io/static/how-to-train-yolov2-to-detect-custom-objects/ 即使我在使用基于yolov3.cfg的网络时也面临一个问题(获得相同的输出)

默认情况下,权重每100次迭代记录一次。你必须等很长时间训练尤洛(尤其是没有GPU)才能用你的体重推断。在

问题是对象txt文件(由yolomarkup创建)几乎都是空的。我添加了3个新的对象;项链,戒指,手表和每个对象约500 jpg图像,我使用了yolomarkup.exe. 对于许多标记的图像,相应的txt文件是空的!我放弃了对那些东西的训练

相关问题 更多 >

    热门问题