Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Training YOLO3 on 16 classes VOC --> error #637

Open
austin880301 opened this issue Apr 4, 2018 · 4 comments
Open

Training YOLO3 on 16 classes VOC --> error #637

austin880301 opened this issue Apr 4, 2018 · 4 comments

Comments

@austin880301
Copy link

Dear sir:

I modify the voc_lable.py for 16 classes and change yolov3-voc-cfg for classes=16, filters=63. and then train the voc.
At last run detect demo with my new weights and the result as following:

FPS:20.1
Objects:

*** Error in `./darknet': free(): invalid pointer: 0x00007f2ff80023d0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f30fb7817e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f30fb78a37a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f30fb78e53c]
./darknet[0x4672e8]
./darknet[0x485597]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f30fbadb6ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f30fb81141d]
======= Memory map: ========
......

best regards

@ahsan856jalal
Copy link

Did you change filters and classes on all three instances in the cfg file

@austin880301
Copy link
Author

austin880301 commented Apr 4, 2018

Thanks a lot , I do not change filters and classes on all three instances in the cfg file. I only change one yolo layer, I should change three yolo layer

@zhangjinsong3
Copy link

@austin880301 ,Excuse me. How to set the 'filters' according to 'classes'

@Ibtastic
Copy link

Ibtastic commented Jan 31, 2020

@zhangjinsong3
Each YOLO layer has 255 outputs: 85 outputs per anchor [4 box coordinates + 1 object confidence + 80 class confidences], times 3 anchors. If you use fewer classes, reduce filters to filters=[4 + 1 + n] * 3, where n is your class count. This modification should be made to the layer preceding each of the 3 YOLO layers. Also modify classes=80 to classes=n in each YOLO layer, where n is your class count (for single class training, n=1)

As mentioned in this ultralytics/yolov3#102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants