What TF version are you using?
Have you checked:

  

      github.com/tensorflow/tensorflow
  

  
    
  
	  
  

  
    
      Error occurred when finalizing GeneratorDataset iterator 102
    

    
      
        opened 
        
          
        
        Dec 14, 2019
      
      

        
          closed 
        
          
        
        Dec 20, 2019
      
        

      
        
          
          olk
        
      
    

    
        TF 2.1
        comp:data
        type:bug
    
  


  
    **System information**
- OS Platform and Distribution: Arch Linux, 5.4.2-arch1-…1-ARCH
- TensorFlow installed from: binary
- TensorFlow version: 2.1.0rc0-1
- Keras version: 2.2.4-tf
- Python version: 3.8
- GPU model and memory: 2x GTX 1080 Ti 11GB"`

**Describe the current behavior**
executing Tensorflow's MNIST handwriting example produces error:
the error dissapears if the code doesn't use OneDeviceStrategy or MirroredStrategy

> W tensorflow/core/kernels/data/generator_dataset_op.cc:103] Error occurred when finalizing GeneratorDataset iterator: Cancelled: Operation was cancelled


**Code to reproduce the issue**


 ```
 import tensorflow as tf
  import tensorflow_datasets as tfds
  import time
  
  from tensorflow.keras.optimizers import Adam
  
  def build_model():
      filters = 48
      units = 24
      kernel_size = 7
      learning_rate = 1e-4
      model = tf.keras.Sequential([
        tf.keras.layers.Conv2D(filters=filters, kernel_size=(kernel_size, kernel_size), activation='relu', input_shape=(28, 28, 1)),
        tf.keras.layers.MaxPooling2D(),
        tf.keras.layers.Flatten(),
        tf.keras.layers.Dense(units, activation='relu'),
        tf.keras.layers.Dense(10, activation='softmax')
      ])
      model.compile(loss='sparse_categorical_crossentropy', optimizer=Adam(learning_rate), metrics=['accuracy'])
      return model
  
  datasets, info = tfds.load(name='mnist', with_info=True, as_supervised=True)
  mnist_train, mnist_test = datasets['train'], datasets['test']
  
  num_train_examples = info.splits['train'].num_examples
  num_test_examples = info.splits['test'].num_examples
  
  strategy = tf.distribute.OneDeviceStrategy(device='/gpu:0')
  
  BUFFER_SIZE = 10000
  BATCH_SIZE = 32
  
  def scale(image, label):
    image = tf.cast(image, tf.float32)
    image /= 255
    return image, label
  
  train_dataset = mnist_train.map(scale).shuffle(BUFFER_SIZE).repeat().batch(BATCH_SIZE).prefetch(buffer_size=tf.data.experimental.AUTOTUNE)
  eval_dataset = mnist_test.map(scale).repeat().batch(BATCH_SIZE).prefetch(buffer_size=tf.data.experimental.AUTOTUNE)
  
  with strategy.scope():
    model = build_model()
  
  epochs=5
  start = time.perf_counter()
  model.fit(
          train_dataset,
          validation_data=eval_dataset,
          steps_per_epoch=num_train_examples/epochs,
          validation_steps=num_test_examples/epochs,
          epochs=epochs)
  elapsed = time.perf_counter() - start
  print('elapsed: {:0.3f}'.format(elapsed))
```