Here is the full source code:
  

      gist.github.com
  

  
    https://gist.github.com/haimat/d5f179b23e61c2b80ba424f988b90c9e 3

  keras-multi-gpu.py
  # Train a Keras model on multiple GPUs in parallel, using TF Dataset slices.

from tensorflow.keras.applications import VGG16
from tensorflow.keras.applications import vgg16
from tensorflow.keras import models
from tensorflow.keras import layers

from sklearn.preprocessing import LabelEncoder
from collections import Counter
from imutils import paths
    This file has been truncated. show original