CleverHans is incompatible with Tensorflow Addons

235 views Asked by At

I have been trying to use CleverHans (https://github.com/tensorflow/cleverhans).

Background

I ran this file here - https://github.com/tensorflow/cleverhans/blob/master/cleverhans_tutorials/mnist_tutorial_tf.py, with Python 3.7.6 and TensorFlow 1.15.3, which led me to the following error:

ImportError: This version of TensorFlow Addons requires TensorFlow version >= 2; Detected an installation of version 1.15.3. Please upgrade TensorFlow to proceed.

However, CleverHans isn't really meant for TensorFlow's versions 2 and above, and they are working on publishing a new version. I actually even updated TensorFlow to 2.3.0 just to see what would happen. That led to a bunch of errors and error-fixing, and finally I got here:

/python3.7/site-packages/cleverhans/initializers.py", line 13, in __init__
super(HeReLuNormalInitializer, self).__init__(dtype=dtype)
TypeError: __init__() got an unexpected keyword argument 'dtype'

Clearly, CleverHans doesn't work with TensorFlow 2.

Question

My question is that how come the fgsm.py file (CleverHans) uses tensorflow_addons when tensorflow_addons doesn't work with TensorFlow <2. Also, I guess the only solution would be to make things work without tensorflow_addons, but I'm not sure how much effort would that be.

Any suggestions related to evading TensorFlow Addons or a completely new approach would be awesome.

Thanks!

0

There are 0 answers