Some mistake when I refer to the book "AI and Machine Learning for Coders"

When I learn the classes, I also refer to the book “AI and Machine Learning for coders”(https://learning.oreilly.com/library/view/ai-and-machine) which is written by the teacher. In chapter 3 the classification of horses and persons task, I found some little misktakes in code:

validation_datagen = ImageDataGenerator(rescale=1/255)

validation_generator = train_datagen.flow_from_directory(
  validation_dir,
  target_size=(300, 300),
  class_mode='binary'
)

the train_datagen is supposed to be validation_generator.

The code in books is a little different from the code performed in class.

I thought that this was a writing mistake. The origin author needs to check.