Closed GoogleCodeExporter closed 9 years ago
The segmentation fault happens in mastertrainer.cpp
void MasterTrainer::WriteInttempAndPFFMTable
INT_TEMPLATES int_templates = classify->CreateIntTemplates(float_classes,shape_set);
Original comment by whoister...@gmail.com
on 14 Aug 2012 at 9:18
Added some printfs to further pinpoint in intproto.cpp
...
ClassId=12679 NumProtos=63 NumConfigs=1 fs.size=1 ProtoId=63 ConfigId=1
ClassId=12680 NumProtos=60 NumConfigs=1 fs.size=1 ProtoId=60 ConfigId=1
ClassId=12681 NumProtos=53 NumConfigs=1 fs.size=1 ProtoId=53 ConfigId=1
ClassId=12682 NumProtos=47 NumConfigs=1 fs.size=1 ProtoId=47 ConfigId=1
ClassId=12683 NumProtos=49 NumConfigs=1 fs.size=1 ProtoId=49 ConfigId=1
ClassId=12684 NumProtos=49 NumConfigs=1 fs.size=1
Looks like I almost completed, but segv in following code
for (ProtoId = 0; ProtoId < FClass->NumProtos; ProtoId++) {
AddIntProto(IClass);
ConvertProto(ProtoIn(FClass, ProtoId), ProtoId, IClass);
AddProtoToProtoPruner(ProtoIn(FClass, ProtoId), ProtoId, IClass,
classify_learning_debug_level >= 2);
AddProtoToClassPruner(ProtoIn(FClass, ProtoId), ClassId, IntTemplates);
}
I am guessing Memory that was previously allocated ran out at this point, I
suspect it's
CLASS_STRUCT* float_classes = SetUpForFloat2Int(*unicharset, mf_classes);
in mftraining.cpp
Original comment by whoister...@gmail.com
on 14 Aug 2012 at 10:48
Turns out in dict/matchdefs.h there is a ClassId limit:
/* define the maximum number of classes defined for any matcher
and the maximum class id for any matcher. This must be changed
if more different classes need to be classified */
#define MAX_NUM_CLASSES 12288
Just change it and mftraining pass.
#define MAX_NUM_CLASSES 22288
Original comment by whoister...@gmail.com
on 15 Aug 2012 at 2:17
Issue 670 has been merged into this issue.
Original comment by theraysm...@gmail.com
on 21 Sep 2012 at 12:24
I noticed this issue is still present since I just had the exact same problem
with the current checkout.
Luckily whoister...'s solution still works, so I've created a diff patch to fix
the issue. (attached)
I wonder if a larger MAX_NUM_CLASSES is known to have an impact on
accuracy/memory/computation/etc. ?
Original comment by clements...@gmail.com
on 8 Dec 2013 at 3:17
Attachments:
This issue was closed by revision r978.
Original comment by theraysm...@gmail.com
on 10 Jan 2014 at 6:25
After more testing the answer was yes it causes significant speed impact.
A fix to this problem is now in test and will be included in 3.03, with
MAX_NUM_CLASSES set to MAX_INT16.
Original comment by theraysm...@gmail.com
on 24 Jan 2014 at 8:03
Original issue reported on code.google.com by
whoister...@gmail.com
on 14 Aug 2012 at 7:51Attachments: