I'm training a Seq2Seq model on Tensorflow on a ml.p3.2xlarge instance. When I tried running the code on google colab, the time per epoch was around 40 mins. However on the instance it's around 5 hours!
This is my training code
def train_model(train_translator, dataset, path, num=8):
with tf.device("/GPU:0"):
cp_callback = tf.keras.callbacks.ModelCheckpoint(filepath=path,
save_weights_only=True,
verbose=1)
batch_loss = BatchLogs('batch_loss')
train_translator.fit(dataset, epochs=num,callbacks=[batch_loss,cp_callback])
return train_translator
I have also tried without the tf.device command and I still get the same timing. Am I doing something wrong?