<h3 dir="auto">System information</h3>
<ul dir="auto">
<li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>: Yes</li>
<li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: Windows 10</li>
<li><strong>TensorFlow installed from (source or binary)</strong>: binary (pip)</li>
<li><strong>TensorFlow version (use command below)</strong>: 1.5.0-dev20171210 (nightly from today)</li>
<li><strong>Python version</strong>: 3.6.2</li>
</ul>
<p dir="auto"><code class="notranslate">ArgMax</code> crashes with <code class="notranslate">no gradient</code> error. I had a working version before I made slight adjustments to my code. I am very confused how this error can happen.</p>
<p dir="auto">Stacktrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  File &quot;C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\learn\python\learn\learn_runner.py&quot;, line 46, in _execute_schedule
    return task()
  File &quot;C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\learn\python\learn\experiment.py&quot;, line 377, in train
    saving_listeners=self._saving_listeners)
  File &quot;C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\learn\python\learn\experiment.py&quot;, line 824, in _call_train
    saving_listeners=saving_listeners)
  File &quot;C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\estimator\estimator.py&quot;, line 314, in train
    loss = self._train_model(input_fn, hooks, saving_listeners)
  File &quot;C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\estimator\estimator.py&quot;, line 743, in _train_model
    features, labels, model_fn_lib.ModeKeys.TRAIN, self.config)
  File &quot;C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\estimator\estimator.py&quot;, line 725, in _call_model_fn
    model_fn_results = self._model_fn(features=features, **kwargs)
  File &quot;C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\gan\python\estimator\python\gan_estimator_impl.py&quot;, line 162, in _model_fn
    add_summaries)
  File &quot;C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\gan\python\estimator\python\gan_estimator_impl.py&quot;, line 235, in _gan_model_fn
    labels=None)
  File &quot;C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\gan\python\estimator\python\head_impl.py&quot;, line 189, in create_estimator_spec
    self._discriminator_optimizer)
  File &quot;C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\gan\python\train.py&quot;, line 540, in gan_train_ops
    **kwargs)
  File &quot;C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\training\python\training\training.py&quot;, line 447, in create_train_op
    colocate_gradients_with_ops=colocate_gradients_with_ops)
  File &quot;C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\training\optimizer.py&quot;, line 456, in compute_gradients
    colocate_gradients_with_ops=colocate_gradients_with_ops)
  File &quot;C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\ops\gradients_impl.py&quot;, line 581, in gradients
    (op.name, op.type))
LookupError: No gradient defined for operation 'Generator/cond/generator/generator/while/BasicDecoderStep/TrainingHelperSample/ArgMax' (op type: ArgMax)"><pre class="notranslate"><code class="notranslate">  File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\learn\python\learn\learn_runner.py", line 46, in _execute_schedule
    return task()
  File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\learn\python\learn\experiment.py", line 377, in train
    saving_listeners=self._saving_listeners)
  File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\learn\python\learn\experiment.py", line 824, in _call_train
    saving_listeners=saving_listeners)
  File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\estimator\estimator.py", line 314, in train
    loss = self._train_model(input_fn, hooks, saving_listeners)
  File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\estimator\estimator.py", line 743, in _train_model
    features, labels, model_fn_lib.ModeKeys.TRAIN, self.config)
  File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\estimator\estimator.py", line 725, in _call_model_fn
    model_fn_results = self._model_fn(features=features, **kwargs)
  File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\gan\python\estimator\python\gan_estimator_impl.py", line 162, in _model_fn
    add_summaries)
  File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\gan\python\estimator\python\gan_estimator_impl.py", line 235, in _gan_model_fn
    labels=None)
  File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\gan\python\estimator\python\head_impl.py", line 189, in create_estimator_spec
    self._discriminator_optimizer)
  File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\gan\python\train.py", line 540, in gan_train_ops
    **kwargs)
  File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\contrib\training\python\training\training.py", line 447, in create_train_op
    colocate_gradients_with_ops=colocate_gradients_with_ops)
  File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\training\optimizer.py", line 456, in compute_gradients
    colocate_gradients_with_ops=colocate_gradients_with_ops)
  File "C:\Development\Tools\miniconda\envs\mpgan-nightly\lib\site-packages\tensorflow\python\ops\gradients_impl.py", line 581, in gradients
    (op.name, op.type))
LookupError: No gradient defined for operation 'Generator/cond/generator/generator/while/BasicDecoderStep/TrainingHelperSample/ArgMax' (op type: ArgMax)
</code></pre></div>
<p dir="auto">LookupError: No gradient defined for operation 'Argmax' (op type: Argmax)</p>