MiraldiLab / maxATAC

Transcription Factor Binding Prediction from ATAC-seq and scATAC-seq with Deep Neural Networks
Apache License 2.0
26 stars 9 forks source link

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

Open XiaotingChen opened 3 years ago

XiaotingChen commented 3 years ago

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

https://github.com/tensorflow/tensorflow/issues/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 commented 2 years ago

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 https://github.com/tensorflow/tensorflow/issues/50204#issuecomment-1007075682.

XiaotingChen commented 1 year ago

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