ankane / eps

Machine learning for Ruby
MIT License
643 stars 15 forks source link

Could not find OpenMP #16

Closed phuibonhoa closed 4 years ago

phuibonhoa commented 4 years ago

In console when I try to build my model I get this error:

LoadError: Could not find OpenMP
    from /Users/user/.rvm/gems/ruby-2.4.6/gems/lightgbm-0.1.7/lib/lightgbm/ffi.rb:10:in `rescue in <module:FFI>'
    from /Users/user/.rvm/gems/ruby-2.4.6/gems/lightgbm-0.1.7/lib/lightgbm/ffi.rb:5:in `<module:FFI>'
    from /Users/user/.rvm/gems/ruby-2.4.6/gems/lightgbm-0.1.7/lib/lightgbm/ffi.rb:2:in `<module:LightGBM>'
    from /Users/user/.rvm/gems/ruby-2.4.6/gems/lightgbm-0.1.7/lib/lightgbm/ffi.rb:1:in `<top (required)>'

Then if I try to build it again I get a different error:

NoMethodError: undefined method `LGBM_DatasetCreateFromMat' for LightGBM::FFI:Module
    from /Users/user/.rvm/gems/ruby-2.4.6/gems/lightgbm-0.1.7/lib/lightgbm/dataset.rb:44:in `initialize'
    from /Users/user/.rvm/gems/ruby-2.4.6/gems/eps-0.3.2/lib/eps/lightgbm.rb:72:in `new'
    from /Users/user/.rvm/gems/ruby-2.4.6/gems/eps-0.3.2/lib/eps/lightgbm.rb:72:in `_train'
    from /Users/user/.rvm/gems/ruby-2.4.6/gems/eps-0.3.2/lib/eps/base_estimator.rb:167:in `train'
    from /Users/user/.rvm/gems/ruby-2.4.6/gems/eps-0.3.2/lib/eps/base_estimator.rb:7:in `initialize'
    from /Users/user/.rvm/gems/ruby-2.4.6/gems/eps-0.3.2/lib/eps/model.rb:47:in `new'
    from /Users/user/.rvm/gems/ruby-2.4.6/gems/eps-0.3.2/lib/eps/model.rb:47:in `train'
    from /Users/user/.rvm/gems/ruby-2.4.6/gems/eps-0.3.2/lib/eps/model.rb:7:in `initialize'
    from /Users/user/Projects/playground/app/ml_models/visit_duration.rb:24:in `new'
    from /Users/user/Projects/playground/app/ml_models/visit_duration.rb:24:in `build'
    from /Users/user/.rvm/gems/ruby-2.4.6/gems/eps-0.3.2/lib/eps/base.rb:5:in `build'

FWIW the version and path brew installed libomp: /usr/local/homebrew/Cellar/libomp/9.0.0

ankane commented 4 years ago

Hey @phuibonhoa, I'm not sure how to reproduce. Can you explain what you mean by "build it again"? Also, if you set the LIGHTGBM_DEBUG environment variable, it'll show a more detailed error message.

ankane commented 4 years ago

Closing due to no response