Trusted-AI / Trusted-AI/AIX360
CEM_MAFImageExplainer - broken Example Notebook
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.8k
- Forks
- 327
- Avg merge
- 1h 13m
- Merged PRs (30d)
- 1
Description
First, I want to thank you very much for providing this toolkit! I am eager to use your implementation for my own research!
Unfortunately, as I was working through the example "CEM-MAF-CelebA.ipynb" notebook for contrastive explanations, I was stopped dead while obtaining the pertinent negative explanation. (Code chunk 12)
Error message:
InvalidArgumentError: Conv2DCustomBackpropInputOp only supports NHWC.
[[{{node gradients/G_paper_1_1/cond/ToRGB_lod8/Conv2D_grad/Conv2DBackpropInput}}]]
During handling of the above exception, another exception occurred:
InvalidArgumentError Traceback (most recent call last)
<ipython-input-13-b1a3ab914e94> in <module>
3 arg_max_iterations, arg_initial_const, arg_gamma, None,
4 arg_attr_reg, arg_attr_penalty_reg,
----> 5 arg_latent_square_loss_reg)
6
7 print(info_pn)
c:\workspaces\aix360\aix360\algorithms\contrastive\CEM_MAF.py in explain_instance(self, sess, input_img, input_latent, arg_mode, arg_kappa, arg_binary_search_steps, arg_max_iterations, arg_initial_const, arg_gamma, arg_beta, arg_attr_reg, arg_attr_penalty_reg, arg_latent_square_loss_reg)
95 attr_penalty_reg=arg_attr_penalty_reg, latent_square_loss_reg=arg_latent_square_loss_reg)
96
---> 97 adv_img = attack_pn.attack(input_img, target_label, input_latent)
98 adv_prob, adv_class, adv_prob_str = self._wbmodel.predict_long(adv_img)
99 attr_mod = self.check_attributes_celebA(self._attributes, input_img, adv_img)
c:\workspaces\aix360\aix360\algorithms\contrastive\CEM_MAF_aen_PN.py in attack(self, imgs, labs, latent)
268 # perform the attack
269
--> 270 self.sess.run([self.train])
271 temp_adv_latent = self.sess.run(self.adv_latent)
272 self.sess.run(self.adv_updater, feed_dict={self.assign_adv_latent: temp_adv_latent})
...
InvalidArgumentError: Conv2DCustomBackpropInputOp only supports NHWC.
[[node gradients/G_paper_1_1/cond/ToRGB_lod8/Conv2D_grad/Conv2DBackpropInput (defined at c:\workspaces\aix360\aix360\algorithms\contrastive\CEM_MAF_aen_PN.py:197) ]]
Errors may have originated from an input operation.
Input Source operations connected to node gradients/G_paper_1_1/cond/ToRGB_lod8/Conv2D_grad/Conv2DBackpropInput:
G_paper_1_1/cond/ToRGB_lod8/mul (defined at <string>:27)
My setup:
I tried this example twice. Once on a windows machine (CPU only) and on a linux machine (CPU only). Both systems error out at the same step. The installation of aix360 worked both times according to the setup instructions in the git documentation.
My hypothesis:
I am thinking that the pickled CelebA model (karras2018iclr-celebahq-1024x1024.pkl) is the cause of this error.
Maybe the problem lies with the requirements. AIX360 needs tensorflow=1.14.0 whereas progressive_growing_of_gans requires tensorflow-gpu>=1.6.0.
I would really appreciate it, if you could help me out on this, as I want to know, if it's a model problem, which I can fix with my own models in the future, or if it's something more complicated than that.
Thank you very much in advance!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce code chunk 12 in CEM-MAF-CelebA.ipynb and inspect the failure path through CEM_MAF.py:97 and CEM_MAF_aen_PN.py:197-270. Compare the documented TensorFlow 1.14 setup with the pickled CelebA model and progressive_growing_of_gans requirements. Done means the pertinent-negative explanation runs successfully, or the supported model and dependency requirements are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, tensorflow
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100