old_contents: # This script accompanies Kaggle's Computer Vision course.
  
  
  # import os, sys
  # os.system("pip install -U -t /kaggle/working/ git+https://github.com/Kaggle/learntools.git@cv-course")
  # sys.path.append('kaggle/working')
  
  # import tensorflow as tf
  # config = tf.compat.v1.ConfigProto()
  # config.gpu_options.allow_growth = True
  # session = tf.compat.v1.InteractiveSession(config=config)
  
  # Imports
  import warnings
  import matplotlib.pyplot as plt
  from matplotlib import gridspec
  import learntools.computer_vision.visiontools as visiontools
  from learntools.computer_vision.visiontools import read_image, show_image, set_seed
  
  import numpy as np
  import tensorflow as tf
  from tensorflow.keras.preprocessing import image_dataset_from_directory
  
  # Reproducability
  set_seed(31415)
  # Set Matplotlib defaults
  plt.rc('figure', autolayout=True)
  plt.rc('axes', labelweight='bold', labelsize='large',
         titleweight='bold', titlesize=18, titlepad=10)
  plt.rc('image', cmap='magma')
  warnings.filterwarnings("ignore") # to clean up output cells
  
  
  # Load training and validation sets
  ds_train_ = image_dataset_from_directory(
      '../input/car-or-truck/train',
      labels='inferred',
      label_mode='binary',
      image_size=[128, 128],
      interpolation='nearest',
      batch_size=64,
      shuffle=True,
  )
  ds_valid_ = image_dataset_from_directory(
      '../input/car-or-truck/valid',
      labels='inferred',
      label_mode='binary',
      image_size=[128, 128],
      interpolation='nearest',
      batch_size=64,
      shuffle=False,
  )
  
  # # Data Pipeline #
  def convert_to_float(image, label):
      image = tf.image.convert_image_dtype(image, dtype=tf.float32)
      return image, label
  
  AUTOTUNE = tf.data.experimental.AUTOTUNE
  ds_train = (
      ds_train_
      .map(convert_to_float)
      .cache()
      .prefetch(buffer_size=AUTOTUNE)
  )
  ds_valid = (
      ds_valid_
      .map(convert_to_float)
      .cache()
      .prefetch(buffer_size=AUTOTUNE)
  )
  
  
new_contents: # This script accompanies Kaggle's Computer Vision course.
  
  # Imports
  import warnings
  import matplotlib.pyplot as plt
  from matplotlib import gridspec
  import learntools.computer_vision.visiontools as visiontools
  from learntools.computer_vision.visiontools import read_image, show_image, set_seed
  
  import numpy as np
  import tensorflow as tf
  from tensorflow.keras.preprocessing import image_dataset_from_directory
  
  # Reproducability
  set_seed(31415)
  # Set Matplotlib defaults
  plt.rc('figure', autolayout=True)
  plt.rc('axes', labelweight='bold', labelsize='large',
         titleweight='bold', titlesize=18, titlepad=10)
  plt.rc('image', cmap='magma')
  warnings.filterwarnings("ignore") # to clean up output cells
  
  
  # Load training and validation sets
  ds_train_ = image_dataset_from_directory(
      '../input/car-or-truck/train',
      labels='inferred',
      label_mode='binary',
      image_size=[128, 128],
      interpolation='nearest',
      batch_size=64,
      shuffle=True,
  )
  ds_valid_ = image_dataset_from_directory(
      '../input/car-or-truck/valid',
      labels='inferred',
      label_mode='binary',
      image_size=[128, 128],
      interpolation='nearest',
      batch_size=64,
      shuffle=False,
  )
  
  # # Data Pipeline #
  def convert_to_float(image, label):
      image = tf.image.convert_image_dtype(image, dtype=tf.float32)
      return image, label
  
  AUTOTUNE = tf.data.experimental.AUTOTUNE
  ds_train = (
      ds_train_
      .map(convert_to_float)
      .cache()
      .prefetch(buffer_size=AUTOTUNE)
  )
  ds_valid = (
      ds_valid_
      .map(convert_to_float)
      .cache()
      .prefetch(buffer_size=AUTOTUNE)
  )
  
  
subject: Remove local compatibility