-
Notifications
You must be signed in to change notification settings - Fork 307
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
ModuleNotFoundError: No module named 'tensorflow.contrib' #182
Comments
@Lawrence-Krukrubo pls try python 3.6 + tf1.14 for CEM. |
I have now installed python=3.6.13 and tf=1.14 Failed to build cvxopt ecos scs what should I do please? |
Hi @vijay-arya I have read your paper "AI Explainability 360: Impact and Design" and the "AI Explainability 360 Toolkit". This toolkit is the focus of my Master's dissertation which I am working on, at the moment. My focus is on CEM and its unique use of PN and PP to justify and improve decisions made to customers. Please, I need this to work, so I can carry out a few experiments locally. Thanks |
@Lawrence-Krukrubo the following should work: git clone https://github.com/Trusted-AI/AIX360 The installation instructions are also available here: https://github.com/Trusted-AI/AIX360/tree/master#installation |
I have done every thing step by step and still getting the same error ModuleNotFoundError: No module named 'tensorflow.contrib the original installation guide on the page you sent has python=3.10 should I try that version of Python? |
I tried to use python=3.10 in a new Conda env and got an incompatibility error for tf=1.14 |
3.10 won't work as Contrastive expects 3.6, which is what I already have in my env. I have python=3.6.13 and tf=1.14 |
Is there anything I can do please, is there a way to run the CEMExplainer from any other application like Watson Studio? Please, I am willing to pay for a subscription to get this to work. My entire dissertation hinges on this please |
I just tried to run the nn.contrastive example and this runs fine. but the CEMExplainer keeps bringing up the module not found error. |
@Lawrence-Krukrubo I hope you are following these steps. Then you should be able to use CEMexplainer. (base)$ (aix360)$ |
yes, I did so and it's just a bit frustrating. Let me delete the old env and start all over again, see if it would work. |
I just followed your steps judiciously one after another. Exactly how you put it and I am despondent and sad to say the same issue persists... ModuleNotFoundError: No module named 'tensorflow.contrib' please isn't there something that can be done, a quick fix or stop-gap just to enable me run my local notebook? |
@Lawrence-Krukrubo when do you get this error. Which notebook you are trying to run and the code that gives you the error. Also some info on the system you are using (windows, mac, etc.) |
I'm using a Windows system. And I get this error whenever I run any code
that has to do with importing CEM or even the Classifier. The moment I run
the examples such as the MNIST CEM notebooks.
But if I ran the nn.contrastive notebooks, these run fine.
I just don't get it as CEM is what I need to do to show the effect of PN
and PP values in my dissertation
…On Mon, 26 Jun 2023, 05:38 Vijay Arya, ***@***.***> wrote:
@Lawrence-Krukrubo <https://github.com/Lawrence-Krukrubo> when do you get
this error. Which notebook you are trying to run and the code that gives
you the error. Also some info on the system you are using (windows, mac,
etc.)
—
Reply to this email directly, view it on GitHub
<#182 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJLJAUAXRPHORRC5HPQXSXLXNEG2TANCNFSM6AAAAAAZS3RYHQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@Lawrence-Krukrubo Since CEM is a white box explainer, the other place to check is if the ML model that you pass to it has been trained using TF 1.14 and not a higher version. CEM is currently tested on windows, mac, & linux for python 3.6, TF1.14. |
I see what you mean, but in this context it doesn't seem to add up.
Like I said earlier the examples in the nn.contrastive folder all run
properly. And remember I created a venv and cloned the repo into it. I have
Python 3.6.13 and TF 1.14 currently working in there.
If I was using the wrong TF version, won't it affect running the
nn.contrastive examples too? These run fine but CEM based modules don't run.
…On Mon, 26 Jun 2023, 09:34 Vijay Arya, ***@***.***> wrote:
@Lawrence-Krukrubo <https://github.com/Lawrence-Krukrubo>
If you are getting ModuleNotFoundError: No module named
'tensorflow.contrib error, then it means you have a higher version of
tensorflow being used somewhere and you are running code that is compatible
with TF1.x
https://stackoverflow.com/questions/55311534/how-to-fix-no-module-named-tensorflow-contrib-for-python-project
Since CEM is a white box explainer, the other place to check if the ML
model that you pass to it has been trained using TF 1.14 and not a higher
version.
CEM is currently tested on windows, mac, & linux for python 3.6, TF1.14.
—
Reply to this email directly, view it on GitHub
<#182 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJLJAUGJTSNXZRBRQMDZDILXNFCRTANCNFSM6AAAAAAZS3RYHQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
To be honest.
I may not need the entire AIX360 package. Just the bit that computes the PN
and PP values in CEM, is enough for my thesis.
If its possible to get functions that can compute these values given a
models prediction. That would be great Arya. Please.
So I can show how PP and PN can produce values that can better inform
credit loan applicants.
…On Mon, 26 Jun 2023, 09:34 Vijay Arya, ***@***.***> wrote:
@Lawrence-Krukrubo <https://github.com/Lawrence-Krukrubo>
If you are getting ModuleNotFoundError: No module named
'tensorflow.contrib error, then it means you have a higher version of
tensorflow being used somewhere and you are running code that is compatible
with TF1.x
https://stackoverflow.com/questions/55311534/how-to-fix-no-module-named-tensorflow-contrib-for-python-project
Since CEM is a white box explainer, the other place to check if the ML
model that you pass to it has been trained using TF 1.14 and not a higher
version.
CEM is currently tested on windows, mac, & linux for python 3.6, TF1.14.
—
Reply to this email directly, view it on GitHub
<#182 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJLJAUGJTSNXZRBRQMDZDILXNFCRTANCNFSM6AAAAAAZS3RYHQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
nn.contrastive is a black box explainer, type of model does not matter. |
Thanks for the tip!
The problem still persists that I cannot use CEM, at this moment I'm not
even trying my own model. I just want to run the CEM examples from the
cloned repo, the MNIST example. If that works, then I can try mine.
But it stills gives the same error message. With Python 3.6.13 and TF 1.14
…On Mon, 26 Jun 2023, 10:28 Vijay Arya, ***@***.***> wrote:
nn.contrastive is a black box explainer, type of model does not matter.
CEM is a white box explainer, its code looks inside the model, so model's
TF version would matter. Pls try using a model trained on TF1.14 if you'd
like to use CEM.
—
Reply to this email directly, view it on GitHub
<#182 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJLJAUARJLLQYKB3BUGDD5LXNFI4JANCNFSM6AAAAAAZS3RYHQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The MNIST example is also run as a test for CEM from here: https://github.com/Trusted-AI/AIX360/blob/master/tests/contrastive/test_CEM.py You can see the test run results here for windows, mac, and linux: |
Thanks, I'll check it out!
…On Mon, 26 Jun 2023, 12:54 Vijay Arya, ***@***.***> wrote:
The MNIST example is also run as a test for CEM from here:
https://github.com/Trusted-AI/AIX360/blob/master/tests/contrastive/test_CEM.py
You can see the test run results here for windows, mac, and linux:
https://github.com/Trusted-AI/AIX360/actions/runs/5375947859/jobs/9752428343
—
Reply to this email directly, view it on GitHub
<#182 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJLJAUCFMMVXASAYPWV72MTXNFZ53ANCNFSM6AAAAAAZS3RYHQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi @vijay-arya something really interesting happened. The Python test file ran successfully. when I tried using a Jupyter Notebook in my venv, I always got the module-not-found-error... But if I put the same code in any script or .py file within my venv, everything works fine! The issue seems to be that jupyter notebook is somehow linked to a different version of tensorflow than the .py script files... |
Any ideas how to fix this? |
Hi @vijay-arya , I have been able to run CEM successfully in venv. The issue was my notebook. venv kept calling jupyter notebook from a different thread with tf > 1.14. So, by some strange feeling, I tried installing jupyter in venv, and voila! it all works well now |
My code tho... I'm getting negative values as the difference between X_pn and X for PN scores. I'm under the impression that X_pn - X should return positive values, reflecting the gap found by the perturbation right? |
I could not install TensorFlow properly while installing contrastive. Please help. :/src/AIX360# pip install -e .[contrastive] :/src/AIX360# python --version |
I have tf==1.14 installed and python 3.7 I have been awake the whole night trying to sort this. Please please help.
My project is on AIX360 and I can't get it to work. Even after cloning the repo, the above error message keeps appearing whenever I load the CEMExplainer and others
The text was updated successfully, but these errors were encountered: