deepmind-research icon indicating copy to clipboard operation
deepmind-research copied to clipboard

tensorflow has no attribute GraphKeys

Open JPFrancis opened this issue 4 years ago • 4 comments

Hi, not urgent, but I am attempting to reproduce the results by running the 'run.sh' script and hitting the error 'tensorflow' has no attribute 'GraphKeys'.

I think this was handled in the quick_eval_cifar.py tensorflow.compat.v1 import but not in the clever_hans scripts from which the error originates. Not sure how to best proceed. Traceback as follows. Any help would be appreciated.

Traceback (most recent call last): File "/home/jpfrancis/anaconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/home/jpfrancis/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/jpfrancis/Development/deepmind-research/unsupervised_adversarial_training/quick_eval_cifar.py", line 30, in from cleverhans import attacks File "/home/jpfrancis/anaconda3/lib/python3.7/site-packages/cleverhans/attacks/init.py", line 9, in from cleverhans.attacks_tf import SPSAAdam, margin_logit_loss, TensorAdam File "/home/jpfrancis/anaconda3/lib/python3.7/site-packages/cleverhans/attacks_tf.py", line 17, in from cleverhans import utils_tf File "/home/jpfrancis/anaconda3/lib/python3.7/site-packages/cleverhans/utils_tf.py", line 341, in loss_collection=tf.GraphKeys.REGULARIZATION_LOSSES): AttributeError: module 'tensorflow' has no attribute 'GraphKeys'

JPFrancis avatar Apr 26 '20 01:04 JPFrancis

Hi @JPFrancis, Which version of tensorflow are you using?

diegolascasas avatar Jun 04 '20 22:06 diegolascasas

Hey, thanks for the reply. This is tensorflow-gpu 1.8.0. Should I upgrade?

MicroscapeInc avatar Jun 05 '20 02:06 MicroscapeInc

Apologies, I was on a company account. The above stands. Thanks

JPFrancis avatar Jun 05 '20 02:06 JPFrancis

Hi @JPFrancis @diegolascasas , I believe that tf.compat.v1 (tf version 1) is already present in the 'quick_eval_cifar.py' script. Cleverhans version 3.1.0 supports TF1x and tf version should be >=1.15 . Cleverhans version 4.0.0 supports only tf 2.0 but some parts require changes to make it compatible with tf2.0 . Also python version should not exceed 3.7 as tf 1x supports till python 3.7 .

abhilash1910 avatar Aug 27 '21 21:08 abhilash1910