title: Error when fitting the model using fit_generator() while applying data augmentation in Tensorflow
body: <p>I'm using tensorflow 2.1.0 on my win10. The version of cuda and cudnn is:</p>
  
  <pre><code># Name                    Version                   Build  Channel
  cudnn                     7.6.5                cuda10.0_0
  </code></pre>
  
  <p>I wanna implement data augmentation with tf.keras.preprocessing.image.ImageDataGenerator() and especially fit_generator() method. But it returned the error:</p>
  
  <pre><code>2020-04-15 15:06:28.571927: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
  2020-04-15 15:06:29.806016: E tensorflow/stream_executor/cuda/cuda_dnn.cc:329] Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED
  2020-04-15 15:06:29.806503: E tensorflow/stream_executor/cuda/cuda_dnn.cc:329] Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED
  Traceback (most recent call last):
    File "E:/Studium/Machine Learning/check2.py", line 112, in &lt;module&gt;
      workers=4)
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\keras\engine\training.py", line 1297, in fit_generator
      steps_name='steps_per_epoch')
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\keras\engine\training_generator.py", line 265, in model_iteration
      batch_outs = batch_function(*batch_data)
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\keras\engine\training.py", line 973, in train_on_batch
      class_weight=class_weight, reset_metrics=reset_metrics)
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\keras\engine\training_v2_utils.py", line 264, in train_on_batch
      output_loss_metrics=model._output_loss_metrics)
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\keras\engine\training_eager.py", line 311, in train_on_batch
      output_loss_metrics=output_loss_metrics))
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\keras\engine\training_eager.py", line 252, in _process_single_batch
      training=training))
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\keras\engine\training_eager.py", line 127, in _model_loss
      outs = model(inputs, **kwargs)
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\keras\engine\base_layer.py", line 891, in __call__
      outputs = self.call(cast_inputs, *args, **kwargs)
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\keras\engine\sequential.py", line 256, in call
      return super(Sequential, self).call(inputs, training=training, mask=mask)
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\keras\engine\network.py", line 708, in call
      convert_kwargs_to_constants=base_layer_utils.call_context().saving)
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\keras\engine\network.py", line 860, in _run_internal_graph
      output_tensors = layer(computed_tensors, **kwargs)
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\keras\engine\base_layer.py", line 891, in __call__
      outputs = self.call(cast_inputs, *args, **kwargs)
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\keras\layers\convolutional.py", line 197, in call
      outputs = self._convolution_op(inputs, self.kernel)
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\ops\nn_ops.py", line 1134, in __call__
      return self.conv_op(inp, filter)
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\ops\nn_ops.py", line 639, in __call__
      return self.call(inp, filter)
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\ops\nn_ops.py", line 238, in __call__
      name=self.name)
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\ops\nn_ops.py", line 2010, in conv2d
      name=name)
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\ops\gen_nn_ops.py", line 1031, in conv2d
      data_format=data_format, dilations=dilations, name=name, ctx=_ctx)
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\ops\gen_nn_ops.py", line 1130, in conv2d_eager_fallback
      ctx=_ctx, name=name)
    File "C:\ProgramData\Miniconda3\envs\TF_2G\lib\site-packages\tensorflow_core\python\eager\execute.py", line 67, in quick_execute
      six.raise_from(core._status_to_exception(e.code, message), None)
    File "&lt;string&gt;", line 3, in raise_from
  tensorflow.python.framework.errors_impl.UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above. [Op:Conv2D]
  </code></pre>
  
  <p>If I don't use that command fit_generator() then everything works just fine. Does anyone know where the problem is? Or how can I implement this with fit() method?</p>