error message on wrong backend
@@ -8,6 +8,8 @@ import argparse
import theano
import theano.tensor as T
+from keras import backend
+
from cleverhans.utils_mnist import data_mnist, model_mnist
from cleverhans.utils_th import th_model_train, th_model_eval, batch_eval
@@ -19,6 +21,11 @@ def main():
MNIST cleverhans tutorial
:return:
"""
+
+ if not hasattr(backend, "theano"):
+ raise RuntimeError("This tutorial requires keras to be configured"
+ " to use the Theano backend.")
+
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--batch_size', '-b', default=128, help='Size of training batches')
