Beispiel #1
0
 def __del__(self):
     if __debug__:
         # TODO: place libsvm versioning information into externals
         debug('SVM_', 'Destroying libsvm v. %s SVMModel %s',
               (hasattr(svmc, '__version__') \
                and svmc.__version__ or "unknown",
                `self`))
     try:
         svmc.svm_destroy_model_helper(self.model)
     except Exception, e:
         # blind way to overcome problem of already deleted model and
         # "SVMModel instance has no attribute 'model'" in  ignored
         if __debug__:
             debug('SVM_', 'Failed to destroy libsvm.SVMModel due to %s' % (e,))
         pass
Beispiel #2
0
 def __del__(self):
     if __debug__:
         # TODO: place libsvm versioning information into externals
         debug('SVM_', 'Destroying libsvm v. %s SVMModel %s',
               (hasattr(svmc, '__version__') \
                and svmc.__version__ or "unknown",
                `self`))
     try:
         svmc.svm_destroy_model_helper(self.model)
     except Exception, e:
         # blind way to overcome problem of already deleted model and
         # "SVMModel instance has no attribute 'model'" in  ignored
         if __debug__:
             debug('SVM_', 'Failed to destroy libsvm.SVMModel due to %s' % (e,))
         pass