-
Notifications
You must be signed in to change notification settings - Fork 2
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
Got ray.serialization.DeserializationError when trying to run KernelShap in distributed mode #1
Comments
Hi @Chen2908 Thank you for raising this. In order for the distributed computation to work your model has to be serialised in the main process so that another process can be spawned on a different core. I suspect your model cannot be deserialised by ray for some reason. This is has to do with the code for your model, so the key to solving this would be to understand what part of your code leads to this. I also see that you are trying to call the distributed shap from inside a class. You might want to try to follow the examples more closely and fit your model first, instantiate it, and then pas It is also useful to check what serialisation protocol is used by the current version of |
Thank you for your reply. Currently I'm experiencing a different issue while computing the explain function: I tried to debug it and I honestly don't know why it is happening... |
Hi @Chen2908 , This might be an issues with the dimensions of the arrays that you feed in. What is the shape of your background data? What about the input to the model? |
Hello,
I read your documentation and blog post and was interested in running KernelShap in distributed mode.
I've installed ray and alibi[ray] as in the documentation. Other packages were already installed.
Running the following code on a binary dataset (1s and 0s as feature values) raised a serialization issue:
opts = {'n_cpus': 19}
start = time.time()
distrib_explainer = KernelShap(self.func_predict, distributed_opts=opts)
distrib_explainer.fit(background_set)
distib_shap_values = distrib_explainer.explain(record_to_explain, nsamples='auto')
print(str(time.time() - start))
This is the error:
raise DeserializationError()
ray.serialization.DeserializationError
Do you know what is the problem and how it can be resolved? Thanks.
The text was updated successfully, but these errors were encountered: