Giter VIP home page Giter VIP logo

Comments (12)

guxiaobo avatar guxiaobo commented on June 16, 2024 1

Hi James, I am sorry , I did not notice your second method post before my last post.
I have tried both methods for both python 3.11.7 and python 3.11.8, these cases all work well.
And the reinstalled lightgbm under my ray env under which I run "pip install -U lightgbm-ray" works well too.

from lightgbm.

jameslamb avatar jameslamb commented on June 16, 2024

Thanks for using LightGBM.

What version of lightgbm do you have and how did you install it?

from lightgbm.

guxiaobo avatar guxiaobo commented on June 16, 2024

I installed the lightgbm-ray 0.1.9 python package which installed lightgbm 4.3.0.

from lightgbm.

jameslamb avatar jameslamb commented on June 16, 2024

Can you please share the model file that you mentioned here: ray-project/ray#44566 (comment)

from lightgbm.

guxiaobo avatar guxiaobo commented on June 16, 2024

model.txt

from lightgbm.

jameslamb avatar jameslamb commented on June 16, 2024

Thanks. We're going to need more information to help you with this.

In ray-project/ray#44566 (comment), you claimed that code like this...

from lightgbm import Booster
booster = Booster(model_file="model.txt")

... "fails". I ran that today on my M2 Mac, with the model file you provided, using Python 3.11 and lightgbm 4.3.0, and did not see it fail.

conda create \
    -c conda-forge \
    --name lgb-test \
        python=3.11 lightgbm=4.3.0

source activate lgb-test

Can you please share the specific commands you used to install lightgbm? e.g. pip install, conda install, something else?

Can you try installing the conda package from conda-forge as I showed above and tell us if it fixes the issue?

from lightgbm.

guxiaobo avatar guxiaobo commented on June 16, 2024

pip install -U lightgbm-ray

from lightgbm.

jameslamb avatar jameslamb commented on June 16, 2024

Ok, are you willing to try conda as in my example above?

If not and you want to stay with pip, can you please try replacing your installation of lightgbm with one that doesn't use OpenMP? We have some known issues with OpenMP support on macOS that are still a work in progress (e.g. #4229).

pip uninstall --yes lightgbm
pip install \
    --no-binary lightgbm \
    --no-cache \
    --config-settings=cmake.define.USE_OPENMP=OFF \
    'lightgbm>=4.3.0'

Please let me know what happens if you try either of those.

Please provide as much information as possible, and if you have not seen it before 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 to help with formatting messages to make the difference between code, text produced by code, and your own words clearer.

from lightgbm.

guxiaobo avatar guxiaobo commented on June 16, 2024

(base) guxiaobo@guxiaobodebijibendiannao Downloads % python
Python 3.11.7 (main, Dec 15 2023, 12:09:56) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.

from lightgbm import Booster
booster = Booster(model_file="model.txt")
zsh: segmentation fault python
(base) guxiaobo@guxiaobodebijibendiannao Downloads %

Python 3.11.8 works fine, it seems a Python version related problem.

from lightgbm.

jameslamb avatar jameslamb commented on June 16, 2024

I asked you to try 2 different installation methods for lightgbm... is this message you just posted the result of trying one of those? If so... which one? And did you try the other one?

We're happy to try to help, but please answer our direct questions.

from lightgbm.

guxiaobo avatar guxiaobo commented on June 16, 2024

(base) guxiaobo@guxiaobodebijibendiannao Downloads % python Python 3.11.7 (main, Dec 15 2023, 12:09:56) [Clang 14.0.6 ] on darwin Type "help", "copyright", "credits" or "license" for more information.

from lightgbm import Booster
booster = Booster(model_file="model.txt")
zsh: segmentation fault python
(base) guxiaobo@guxiaobodebijibendiannao Downloads %

Python 3.11.8 works fine, it seems a Python version related problem.
This output is in the ray env which lightgbm is installed by "pip install -U lightgbm-ray"

from lightgbm.

jameslamb avatar jameslamb commented on June 16, 2024

No problem!

all works well

Ok great! Then yes I strongly suspect this is related to OpenMP compatibility issues. Until you see that #4229 is closed, I recommend using the lightgbm package from conda-forge on the M3 Mac.

Very sorry for the difficulty. macOS packaging is an area I'm focusing on for the next release of LightGBM, hopefully this will get better soon. You can subscribe to #4229 to be notified of changes.

Since it seems like we've identified the root cause and found a fix, I'm going to close this. Please comment if you have any other concerns.

from lightgbm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.