I am currently using tensorflow and following tutorial https://www.tensorflow.org/text/tutorials/nmt_with_attention I am trying to make a Korean to English translator by referring to the above document. However, while training in TensorFlow, the code throws the following error:
EPOCHS = 10
for epoch in range(EPOCHS):
start = time.time()
enc_hidden = encoder.initialize_hidden_state()
total_loss = 0
for (batch, (inp, targ)) in enumerate(dataset.take(steps_per_epoch)):
batch_loss = train_step(inp, targ, enc_hidden)
total_loss += batch_loss
if batch % 100 == 0:
print('Epoch {} Batch {} Loss {:.4f}'.format(epoch + 1,
batch,
batch_loss.numpy()))
# 에포크가 2번 실행될때마다 모델 저장 (체크포인트)
if (epoch + 1) % 2 == 0:
checkpoint.save(file_prefix = checkpoint_prefix)
print('Epoch {} Loss {:.4f}'.format(epoch + 1,
total_loss / steps_per_epoch))
print('Time taken for 1 epoch {} sec\n'.format(time.time() - start))
error message: enter image description here
I would like to know why this graph error occurs. I'm not sure of the problem myself, so I'm attaching a google drive link with my code.
https://drive.google.com/file/d/118ouco4cH-kyOt7Nezqad3Qm66QexbsO/view?usp=sharing
thank you.