interpretml / interpret

Fit interpretable models. Explain blackbox machine learning.
https://interpret.ml/docs
MIT License
6.22k stars 726 forks source link

Error happened on MAC with chip M2 #472

Open liuying611 opened 1 year ago

liuying611 commented 1 year ago

I'm trying to follow the Notebook for reproducing table. But an error occurred here result = benchmark_models('heart', dataset['full']['X'], dataset['full']['y'], n_splits=n_splits). It says OSError: dlopen(/Users/yaoyao/miniconda3/envs/ip/lib/python3.9/site-packages/interpret/utils/../lib/libebm_mac_arm.dylib, 0x0006): tried: '/Users/yaoyao/miniconda3/envs/ip/lib/python3.9/site-packages/interpret/utils/../lib/libebm_mac_arm.dylib' (no such file). I installed the package libomp, then I realized the key problem is "arm", my MAC is Apple M2. Do you have any idea how could I fix this, or simply avoid this error?

paulbkoch commented 1 year ago

Hi @LiuYingyingCSU -- That's interesting. Can you give me the output of:

ls -l /Users/yaoyao/miniconda3/envs/ip/lib/python3.9/site-packages/interpret/lib
liuying611 commented 1 year ago

yes, here it is

image
paulbkoch commented 1 year ago

Ok, that's fairly surprising to me. The installation process should put shared libraries for all the major OSes in there, including one for the Mac m1. Even if the m2 wasn't able to load the m1's shared library, I'd still expect a DLL for windows and an .so file for linux in there.

Is there anything surprising in your environment or installation method that would be pertinent? Are you using a straight-up "pip install interpret"?

My first thought towards resolution would be to try installing interpret into a fresh environment. Perhaps something just got corrupted during the installation.

paulbkoch commented 1 year ago

Another idea: Are there any virus scanners or other corporate software running that could have deleted native code?

liuying611 commented 1 year ago

GOOD news! Following your advice, things go well after I did conda uninstall interpret, then pip install interpret (installed it using conda before). No error occurs now. Let me recurrent the whole process:

  1. Create a fresh new environment using conda, and python version = 3.9.17
  2. conda install -c conda-forge interpret
  3. run the code in the above mentioned jupyter code, error occurred.
  4. reinstall again, also use conda install -c conda-forge interpret, error still exist
  5. at last, uninstall, then reinstall using pip install interpret

Well, in case the error occurred because the conda install process was not complete for some reason. To figure it out, I again:

  1. create another new environment,
  2. conda install -c conda-forge interpret,
  3. then run the code, error again.
  4. Try pip, error gone.

That's all, hope I provide enough useful information. Anyway, things working well now. Thank you

paulbkoch commented 1 year ago

Ah, ok. I could see conda having an issue on an m2. I'll take a look at that code and try to fix whatever the issue is.

sarim-zafar commented 10 months ago

+1 Just happened to me as well but in my case it was a M1 Pro chip

paulbkoch commented 9 months ago

Hi @liuying611 and @sarim-zafar -- I think the mac m1/m2 issue has been resolved with the release of v0.5.0 on conda-forge. I don't have an m1 to test with though, so this is unconfirmed at the moment.