-1

Dearest S/O community, I can't seem to pinpoint the reason my python kernel dies throwing

`Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)`,

be it when I attempt to load an LGBM model from a pickle file or train anew.

Example code would be

import lightgbm as lgb
import numpy as np

# generate sample data
data = np.random.rand(500, 10)
label = np.random.randint(2, size=500)
train_data = lgb.Dataset(data, label=label)


# set metrics
param = dict(num_leaves=31, objective="binary", metric="auc")

# training
num_round = 10
best_model = lgb.train(params=param,
                       train_set=train_data,
                       num_boost_round=num_round)

There were no errors thrown when LightGBM was installed as brew install lightgbm or when pip install lightgbm in a conda env.

System information:

Last updated: 2021-08-15T16:50:19.355453+02:00

Python implementation: CPython
Python version       : 3.9.5
IPython version      : 7.25.0

Compiler    : Clang 10.0.0 
OS          : Darwin
Release     : 20.5.0
Machine     : x86_64
Processor   : i386
CPU cores   : 12
Architecture: 64bit

Some of the packages installed in the environment

pandas  : 1.3.0
numpy   : 1.21.0
sklearn : 0.24.2
lightgbm: 3.2.1

Need help!

Cheers :)

Subbu
  • 37
  • 5
  • This question is missing significant details. For example, it is missing a reproducible example (or at least rough sample code) showing how you created the model pickle file and how you are attempting to load it, the Python version you're using, and the LightGBM version you're using. More details on what is meant by "the example classifier in the documentation fails" would also be helpful. – James Lamb Aug 14 '21 at 04:34
  • 1
    This needs a [mcve]. Your code starts with an undefined `get_data()` call, which isn't helpful. As a new user, also take the [tour] and read [ask] – Ulrich Eckhardt Aug 14 '21 at 08:14
  • Is this informative enough? I'm sorry but this is all that I've got and I do not know how to proceed with this as I have another system (a Mac again) where the above steps produced no errors and the code I've chalked out executed just fine! I'm sure that there is something wrong with installation prerequisites? Appreciate any help! Any further edits to "reproducible code" is just beyond me! Thanks! – Subbu Aug 15 '21 at 14:55

1 Answers1

1

Okay, I fixed this issue by installing lightgbm in a new environment. Some version mismatches among the set of all installed packages seems to be the root cause of the error. There are way too many packages being used in my setup to post them all here. But fundamentally, the environments differed in the presence (or absence) of geoPandas.

Issue was that the installation didn't seem highlight any version mismatches either!

So I'm leaving this 'meh' brute force solution here in case it were to help someone else - Install LightGBM in a fresh env. and install other relevant packages backwards.

Cheers.

Subbu
  • 37
  • 5