Skip to content

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

Description

@XiaotingChen

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions