amiratag / DataShapley

Data Shapley: Equitable Valuation of Data for Machine Learning
MIT License
256 stars 66 forks source link

Compatibility with tensorflow 2 #1

Closed GISH123 closed 6 months ago

GISH123 commented 5 years ago

To make the code compatiable with tensorflow 2.0, (1) I just modified every set_random_seed to set_seed (2) Everything that used old tensorflow and disappeared in tf2, I added code tf."compat.v1." to make them work

GISH123 commented 5 years ago

And if you have the time, I actually wonder if it is possible to use data shapley on a pre-trained model (MobileNetV2 on ImageNet)? If so, how? Im currently working on realizing DataShapley to some models, but I don't know how. Thanks in advance!

GISH123 commented 5 years ago

Sorry i just knew the better method of compatibility code Just change every " import tensorflow as tf" to "import tensorflow.compat.v1 as tf tf.disable_v2_behavior()" for the 3 python file( DShap.py, shap_utils.py and Shapley.py) and it will be good to go.