-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[python-package] fit() segfaults #6025
Comments
Thanks for using LightGBM and for the write-up with a reproducible example. What operating system are you on? If on macOS, what version of OpenMP do you have installed? I ask in case you might be facing an issue like #4229. Could you also check... do you have multiple copies of find "${HOME}" -name 'lib_lightgbm.so' |
Hi, find "${HOME}" -name 'lib_lightgbm.so' /Users/sumen/anaconda3/pkgs/lightgbm-3.3.5-py310h313beb8_0/lib/python3.10/site-packages/lightgbm/lib_lightgbm.so |
Aha! Having those two copies of Also, since both of these are in paths like Try this:
conda uninstall --yes lightgbm
pip uninstall --yes lightgbm 2a. Run the # this should now return 0 results
find "${HOME}/anaconda3" -name 'lib_lightgbm.so' 2b. If that /Users/sumen/anaconda3/pkgs/lightgbm-3.3.5-py310h313beb8_0/lib/python3.10/site-packages/lightgbm/lib_lightgbm.so
conda install -c conda-forge --yes lightgbm
Please let me know how that goes. |
Hi, I tried reinstalled and got a dependency error. conda install -c conda-forge --yes lightgbm
|
I've reformatted your post, to make the diference between your own words, commands you ran, and logs from those commands clearer. If you're not familiar with how to do that, please read https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax. Based on your most recent message, it seems to me that your That is not a The risk of this happening is why I personally try to avoid using the base conda environment, and always create dedicated environments for different projects. Try the following.
rm -r /Users/sumen/anaconda3
conda create \
--name ml-dev \
-c conda-forge \
--yes \
ipykernel \
jupyterlab \
'lightgbm>=4.0.0' \
numpy \
'python=3.11' \
scikit-learn \
scipy
source activate ml-dev
jupyter lab
import lightgbm as lgb
from sklearn.datasets import make_regression
X, y = make_regression(n_samples=1_000)
dtrain = lgb.Dataset(X, label=y)
bst = lgb.train(
train_set=dtrain,
params={
"objective": "regression",
"num_iterations": 10
}
) |
Hello, |
Great, glad it helped! Thanks for using LightGBM, come back any time 👋🏻 |
This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this. |
Hello team,
I ran the code below and ran into a strange behavior, the fit method kills the Jupyter kernel.
LightGBM version:
lightgbm (4.0.0)
Command(s) used to install LightGBM
Additional Comments
When I ran the the code in a .py file, this is the error message:
collecting ... collected 1 item
test.py::test Fatal Python error: Segmentation fault
Thread 0x00000001f964a500 (most recent call first):
File "/Users/sumen/anaconda3/lib/python3.10/site-packages/lightgbm/basic.py", line 1990 in __init_from_np2d
File "/Users/sumen/anaconda3/lib/python3.10/site-packages/lightgbm/basic.py", line 1856 in _lazy_init
File "/Users/sumen/anaconda3/lib/python3.10/site-packages/lightgbm/basic.py", line 2210 in construct
File "/Users/sumen/anaconda3/lib/python3.10/site-packages/lightgbm/basic.py", line 3096 in init
File
Could you please advise how would it be possible to tackle this point?
Thank you!
The text was updated successfully, but these errors were encountered: