Skip to content
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

OSError: exception: access violation writing #1475

Closed
leftluoyi opened this issue Jun 25, 2018 · 11 comments
Closed

OSError: exception: access violation writing #1475

leftluoyi opened this issue Jun 25, 2018 · 11 comments

Comments

@leftluoyi
Copy link

leftluoyi commented Jun 25, 2018

Windows 10 + Python 3.6.3 x64 + CUDA 8.0

Have successfully installed LightGBM and can run the binary_classification example from command prompt.

If set the classifier as XGBClassifier, everything is okay. When change to LGBMClassifier, the following exceptions is thrown.

 File "D:\Anaconda3\lib\site-packages\lightgbm\sklearn.py", line 695, in fit
    callbacks=callbacks)
  File "D:\Anaconda3\lib\site-packages\lightgbm\sklearn.py", line 474, in fit
    callbacks=callbacks)
  File "D:\Anaconda3\lib\site-packages\lightgbm\engine.py", line 183, in train
    booster = Booster(params=params, train_set=train_set)
  File "D:\Anaconda3\lib\site-packages\lightgbm\basic.py", line 1307, in __init__
    train_set.construct().handle,
  File "D:\Anaconda3\lib\site-packages\lightgbm\basic.py", line 860, in construct
    categorical_feature=self.categorical_feature, params=self.params)
  File "D:\Anaconda3\lib\site-packages\lightgbm\basic.py", line 714, in _lazy_init
    self.__init_from_np2d(data, params_str, ref_dataset)
  File "D:\Anaconda3\lib\site-packages\lightgbm\basic.py", line 776, in __init_from_np2d
    ctypes.byref(self.handle)))
OSError: exception: access violation writing 0xFFFFFFFF98090000

Any idea?

======================== UPDATE ==========================

Now I can run this example with CPU version and GPU version with lightgbm.exe, but the GPU version with python throws this exception.

@guolinke
Copy link
Collaborator

are you on the latest version ?

@guolinke
Copy link
Collaborator

BTW, can you provide a re-produce code with randomly generated data ?

@leftluoyi
Copy link
Author

@guolinke I think I am, just cloned LightGBM half an hour ago.

@leftluoyi
Copy link
Author

I tried with this example. The problem still exists.

@guolinke
Copy link
Collaborator

just run it without error:
image

@guolinke
Copy link
Collaborator

can you try to uninstall and re-install ? you can install version 2.1.2 from pypi directly.

@leftluoyi
Copy link
Author

@guolinke I will try to reinstall. BTW, here is what I got.
image

@guolinke
Copy link
Collaborator

BTW, we have the tests for these examples in Windows: https://github.com/Microsoft/LightGBM/blob/master/.appveyor.yml#L51-L58
So these examples should be run without errors, since the tests are passed

@leftluoyi
Copy link
Author

@guolinke Thanks for the advice. I installed the cpu version via pip install lightgbm and things works fine. But I forgot to mention that I am trying with gpu version. So if I install with pip install lightgbm --install-option=--gpu --install-option=--mingw, the access violation exception happens again.

@guolinke
Copy link
Collaborator

ping @huanzhang12 @StrikerRUS

@leftluoyi
Copy link
Author

The problem is solved by update relevant packages by pip install setuptools numpy scipy scikit-learn -U. @guolinke thanks for your advice. Please close this issue.

@lock lock bot locked as resolved and limited conversation to collaborators Mar 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants