You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also posted as a reply under a similar issue, but as this concerns the sklearn implementation (of AdversarialDebiasing) and cloudpickle combo specifically, I thought to also open a separate issue.
I tried this using the sklearn version. But when I try to pickle.dump() using cloudpickle, I get an error saying "cannot pickle 'Graph' object".
I'm not even sure why a fitted AdversarialDebiasing model would be a 'Graph' object.
cloudpickle version = 1.5.0
aif360 version = 0.5.0
EDIT: Same error when using regular pickle
In the example below X is a DataFrame that includes 'protfeat' set as index and y is a numpy array of 1/0 labels.
from aif360.sklearn.inprocessing import AdversarialDebiasing
import tensorflow.compat.v1 as tf
from aif360.datasets import StandardDataset
import pandas as pd
from cloudpickle import pickle
tf.disable_eager_execution()
sess = tf.Session()
model = AdversarialDebiasing(
prot_attr='protfeat',
scope_name='debiased_model',
num_epochs=50,
batch_size=128,
debias=True,
random_state=1337,
classifier_num_hidden_units=200
)
model.fit(X, y)
with open(os.path.join(folder.get_path(), 'test_pickle.pkl'), 'w') as f:
pickle.dump(model, f)
The text was updated successfully, but these errors were encountered:
evilantal
changed the title
error when using cloudpickle to dump a fitted sklearn AdversarialDebiasing model
error when using (cloud)pickle to dump a fitted sklearn AdversarialDebiasing model
Sep 13, 2023
Also posted as a reply under a similar issue, but as this concerns the sklearn implementation (of AdversarialDebiasing) and cloudpickle combo specifically, I thought to also open a separate issue.
I tried this using the sklearn version. But when I try to pickle.dump() using cloudpickle, I get an error saying "cannot pickle 'Graph' object".
I'm not even sure why a fitted AdversarialDebiasing model would be a 'Graph' object.
cloudpickle version = 1.5.0
aif360 version = 0.5.0
EDIT: Same error when using regular pickle
In the example below X is a DataFrame that includes 'protfeat' set as index and y is a numpy array of 1/0 labels.
The text was updated successfully, but these errors were encountered: