Giter VIP home page Giter VIP logo

Comments (9)

cwmeijer avatar cwmeijer commented on August 10, 2024

use
https://github.com/onnx/onnx-tensorflow/graphs/contributors
first try it on our models.

from dianna.

cwmeijer avatar cwmeijer commented on August 10, 2024

Explored it with a single model (leafsnap) and predictions were equivalent to the original onnx. Script can be found here:
https://github.com/dianna-ai/dianna-exploration/blob/56-onnx-to-tf-exploration/onnx_conversion_scripts/onnx_to_tensorflow.ipynb

from dianna.

elboyran avatar elboyran commented on August 10, 2024

Can somebody who has time, please test the Tutorial notebook of onnx-tensorflow executing exactly the same notebook and just appending it with the shap step to see if it works?

from dianna.

loostrum avatar loostrum commented on August 10, 2024

That tutorial didn't work for me even without changing anything, the model they provide fails when running prepare (see also the discussion in the teams channel). I couldn't find which versions of e.g. tensorflow they used.

I did do some tests together with Chris and Yang, see this notebook: https://github.com/dianna-ai/dianna-exploration/blob/test-shap-tf-onnx/onnx_conversion_scripts/test_shap_tf_onnx.ipynb
We're getting further, i.e. we can generate an explainer object, but getting the shap values still fails.
shap also fails on a native keras model (see the same notebook), it looks like the DeepExplainer is not (fully) compatible with tensorflow 2, or at least not with recent versions.

from dianna.

cwmeijer avatar cwmeijer commented on August 10, 2024

2 remarks:

from dianna.

elboyran avatar elboyran commented on August 10, 2024

Note that the relevant branches are in dianna-exploration. If it results in a PR we should not forget it in the stand-ups.

from dianna.

elboyran avatar elboyran commented on August 10, 2024

My interpretations of the errors we got in https://github.com/dianna-ai/dianna-exploration/blob/test-shap-tf-onnx/onnx_conversion_scripts/test_shap_tf_onnx.ipynb:

For our model- the warning after cell [21] about exporting a tensor dict might be related to the error later after cell [24]:

TypeError: Expected any non-tensor type, got a tensor instead.

Looks like versioning issues indeed. But maybe we can try not with mnist. but another or our models? I recall @geek-yang saying the mnist had a different structure after conversion than the others.

For the native Keras model: I can report our error also in their issue, hoping someone will pay attention. Also worth looking at how the skomatin guy changed his model and avoided the error (post from 11 Sep 2020). He thinks shap does not support TF 2.0 :-( @loostrum what shap and TF versions did you use?

from dianna.

elboyran avatar elboyran commented on August 10, 2024

One more tough: if DeepExplainer attempts ultimately fail, any point of trying the slower Shap's KernalExplainer?

https://github.com/slundberg/shap

from dianna.

loostrum avatar loostrum commented on August 10, 2024

I tried the latest version of shap (0.40), a slightly older version (0.38) and the latest master branch.
Using tensorflow 2.6

from dianna.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.