thundergbm icon indicating copy to clipboard operation
thundergbm copied to clipboard

c_ints required to convert parameters to thundergbm.sparse_train_scikit

Open civilinformer opened this issue 4 years ago • 1 comments

I am trying to run thundergbm under Ubuntu 18.04, cuda 10.2 driver 440.64.00. I was getting the following error:

~/venv/tf2/lib/python3.6/site-packages/thundergbm/thundergbm.py in fit(self, X, y, groups) 96 fit = self._sparse_fit 97 ---> 98 fit(X, y, groups=groups) 99 return self 100 ~/venv/tf2/lib/python3.6/site-packages/thundergbm/thundergbm.py in _sparse_fit(self, X, y, groups) 128 n_class, self.tree_method.encode('utf-8'), byref(self.model), tree_per_iter_ptr, 129 group_label, --> 130 in_groups, num_groups) 131 self.num_class = n_class[0] 132 self.tree_per_iter = tree_per_iter_ptr[0] ArgumentError: argument 6: <class 'TypeError'>: Don't know how to convert parameter 6

The following modification allows the code to run:

depth = c_int(int(self.depth)); n_trees = c_int(int(self.n_trees)) thundergbm.sparse_train_scikit(X.shape[0], data, indptr, indices, label, depth, n_trees, I previously had to do a very similar fix for thundersvm, see https://github.com/Xtra-Computing/thundersvm/issues/210.

It might be helpful to treat the integers consistently.

civilinformer avatar Jun 12 '20 16:06 civilinformer

Thanks for informing. This will help us make better software.

Kurt-Liuhf avatar Jun 13 '20 04:06 Kurt-Liuhf