openphilanthropy / unrestricted-adversarial-examples

Contest Proposal and infrastructure for the Unrestricted Adversarial Examples Challenge
Apache License 2.0
327 stars 62 forks source link

`train_two_class_mnist.py` fails #37

Closed ddkang closed 5 years ago

ddkang commented 5 years ago

I'm using TF 1.10 and followed the instructions here: https://github.com/google/unrestricted-adversarial-examples/blob/master/warmup.md

Here's the error log:

/afs/cs.stanford.edu/u/ddkang/.virtualenvs/fd/lib/python3.5/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
WARNING:tensorflow:From /lfs/1/ddkang/adv-unrestricted/code/unrestricted-adversarial-examples/unrestricted-advex/unrestricted_advex/mnist_baselines/mnist_utils.py:15: read_data_sets (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use alternatives such as official/mnist/dataset.py from tensorflow/models.
WARNING:tensorflow:From /afs/cs.stanford.edu/u/ddkang/.virtualenvs/fd/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:260: maybe_download (from tensorflow.contrib.learn.python.learn.datasets.base) is deprecated and will be removed in a future version.
Instructions for updating:
Please write your own downloading logic.
WARNING:tensorflow:From /afs/cs.stanford.edu/u/ddkang/.virtualenvs/fd/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:262: extract_images (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use tf.data to implement this functionality.
Extracting MNIST_data/train-images-idx3-ubyte.gz
WARNING:tensorflow:From /afs/cs.stanford.edu/u/ddkang/.virtualenvs/fd/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:267: extract_labels (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use tf.data to implement this functionality.
Extracting MNIST_data/train-labels-idx1-ubyte.gz
WARNING:tensorflow:From /afs/cs.stanford.edu/u/ddkang/.virtualenvs/fd/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:110: dense_to_one_hot (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use tf.one_hot on tensors.
Extracting MNIST_data/t10k-images-idx3-ubyte.gz
Extracting MNIST_data/t10k-labels-idx1-ubyte.gz
WARNING:tensorflow:From /afs/cs.stanford.edu/u/ddkang/.virtualenvs/fd/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/datasets/mnist.py:290: DataSet.__init__ (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use alternatives such as official/mnist/dataset.py from tensorflow/models.
WARNING:tensorflow:From /lfs/1/ddkang/adv-unrestricted/code/unrestricted-adversarial-examples/unrestricted-advex/unrestricted_advex/mnist_baselines/mnist_convnet.py:69: UniformUnitScaling.__init__ (from tensorflow.python.ops.init_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.initializers.variance_scaling instead with distribution=uniform to get equivalent behavior.
WARNING:tensorflow:From /lfs/1/ddkang/adv-unrestricted/code/unrestricted-adversarial-examples/unrestricted-advex/unrestricted_advex/mnist_baselines/mnist_utils.py:117: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version.
Instructions for updating:

Future major versions of TensorFlow will allow gradients to flow
into the labels input on backprop by default.

See @{tf.nn.softmax_cross_entropy_with_logits_v2}.

WARNING:tensorflow:From /lfs/1/ddkang/adv-unrestricted/code/unrestricted-adversarial-examples/unrestricted-advex/unrestricted_advex/mnist_baselines/mnist_utils.py:123: get_or_create_global_step (from tensorflow.contrib.framework.python.ops.variables) is deprecated and will be removed in a future version.
Instructions for updating:
Please switch to tf.train.get_or_create_global_step
2018-09-19 18:41:04.719526: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2018-09-19 18:41:05.598079: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1405] Found device 0 with properties: 
name: Tesla P100-PCIE-16GB major: 6 minor: 0 memoryClockRate(GHz): 1.3285
pciBusID: 0000:05:00.0
totalMemory: 15.90GiB freeMemory: 15.61GiB
2018-09-19 18:41:05.598120: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1484] Adding visible gpu devices: 0
2018-09-19 18:41:05.871630: I tensorflow/core/common_runtime/gpu/gpu_device.cc:965] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-09-19 18:41:05.871673: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971]      0 
2018-09-19 18:41:05.871679: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] 0:   N 
2018-09-19 18:41:05.872043: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1097] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 15123 MB memory) -> physical GPU (device: 0, name: Tesla P100-PCIE-16GB, pci bus id: 0000:05:00.0, compute capability: 6.0)
Traceback (most recent call last):
  File "train_two_class_mnist.py", line 23, in <module>
    tf.app.run()
  File "/afs/cs.stanford.edu/u/ddkang/.virtualenvs/fd/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 125, in run
    _sys.exit(main(argv))
  File "train_two_class_mnist.py", line 19, in main
    FLAGS.total_batches, FLAGS.train_mode)
  File "/lfs/1/ddkang/adv-unrestricted/code/unrestricted-adversarial-examples/unrestricted-advex/unrestricted_advex/mnist_baselines/mnist_utils.py", line 145, in train_mnist
    x_batch, y_batch, _ = next_batch_fn()
ValueError: not enough values to unpack (expected 3, got 2)
nottombrown commented 5 years ago

Whoops, I broke this in a recent refactor. Fixing now.

nottombrown commented 5 years ago

Solved in #38 . Try pulling now.

nottombrown commented 5 years ago

We will move to semantic versioning in the near future so that you can avoid getting broken by changes to the API.

nottombrown commented 5 years ago

Closing this issue. Let me know if you run into any other issues!