Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in
bob.learn.libsvm
bob.learn.libsvm
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • bob
  • bob.learn.libsvmbob.learn.libsvm
  • Issues
  • #9

Closed
Open
Opened Apr 08, 2017 by Tiago de Freitas Pereira@tiago.pereira
  • Report abuse
  • New issue
Report abuse New issue

SVM in sequence segmenation fault

When you try to train several SVMs in sequence we have segmentation fault.

Follow a code that reproduces the issue (2 SVMs in sequence):

import bob.learn.libsvm
import numpy
numpy.random.seed(10)

for i in range(2):
    pos = numpy.random.normal(0., 1, size=(100, 2))
    neg = numpy.random.normal(1., 1, size=(100, 2))
    data = [pos, neg]

    trainer = bob.learn.libsvm.Trainer()
    trainer.kernel_type = 'LINEAR'
    trainer.cost = 1
    trainer.train(data)

However, if you free the data variables in the end of loop for, everything runs fine

import bob.learn.libsvm
import numpy
numpy.random.seed(10)

for i in range(2):
    pos = numpy.random.normal(0., 1, size=(100, 2))
    neg = numpy.random.normal(1., 1, size=(100, 2))
    data = [pos, neg]

    trainer = bob.learn.libsvm.Trainer()
    trainer.kernel_type = 'LINEAR'
    trainer.cost = 1
    trainer.train(data)

    del data
    del pos
    del neg   

I'm still debugging, but it seems that the issue is somewhere here in the bindings (https://gitlab.idiap.ch/bob/bob.learn.libsvm/blob/master/bob/learn/libsvm/trainer.cpp#L616)

Assignee
Assign to
Bob 2.7.x release
Milestone
Bob 2.7.x release
Assign milestone
Time tracking
None
Due date
None
1
Labels
bug
Assign labels
  • View project labels
Reference: bob/bob.learn.libsvm#9