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

Numpy compatibility for Tensorflow 2.5 and SHAP in interpreting analysis jobs #58

Open
XiaotingChen opened this issue Sep 9, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@XiaotingChen
Copy link
Collaborator

We have this conflict between tensorflow and shap, where tensorflow 2.5 cannot work with numpy >=1.20.0 and shap is compiled with numpy API version 0xe (numpy >=1.20.0 I believe, the current installation of numpy==1.19.5 is with API version 0xd).

import shap
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd

tensorflow/tensorflow#50204

The API version from 1.20.x looks like below:

#define NPY_1_7_API_VERSION 0x00000007
#define NPY_1_8_API_VERSION 0x00000008
#define NPY_1_9_API_VERSION 0x00000008
#define NPY_1_10_API_VERSION 0x00000008
#define NPY_1_11_API_VERSION 0x00000008
#define NPY_1_12_API_VERSION 0x00000008
#define NPY_1_13_API_VERSION 0x00000008
#define NPY_1_14_API_VERSION 0x00000008
#define NPY_1_15_API_VERSION 0x00000008
#define NPY_1_16_API_VERSION 0x00000008
#define NPY_1_17_API_VERSION 0x00000008
#define NPY_1_18_API_VERSION 0x00000008
#define NPY_1_19_API_VERSION 0x00000008
#define NPY_1_20_API_VERSION 0x0000000e (different from previous 1.19.x version)

https://github.com/numpy/numpy/blob/maintenance/1.20.x/numpy/core/include/numpy/numpyconfig.h

@XiaotingChen
Copy link
Collaborator Author

XiaotingChen commented Jun 8, 2022

As TF 2.9 will be used for public release along with other progresses in model interpreting, we might want to consider re-open this and test the interpreting functionality at some point. It seems the library conflicts have been resolved with TF >=2.7, see tensorflow/tensorflow#50204 (comment).

@tacazares tacazares reopened this Jun 8, 2022
@XiaotingChen
Copy link
Collaborator Author

This problem should be resolved with the following library versions.
tensorflow: 2.12.0
numpy: 1.22.3
shap: 0.29.3
modisco: 0.5.16.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants