Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
indent error
#1
Dear Python Experts,

I am new to python and trying to get familar with Keras.

I have the following line in my code that executes fine:

    kl.train(train_gen,
             val_gen,
             saved_model_path=model_path,
             steps=steps_per_epoch,
             train_split=cfg.TRAIN_TEST_SPLIT)
Now I want to add the following ahead of this code:

	kl.callbacks.EarlyStopping(monitor='val_loss',
                                min_delta=0,
                                patience=0,
                                verbose=0, 
                                mode='auto')
but every time I do that. I get an indent error.

The whole code is here:

https://github.com/wroscoe/donkey/blob/m...donkey2.py

Line 162. I try to add kl.callbacks just before line 162.

Why does this indent error come up even when I use tab to ident the code like the original kl.train?
Reply
#2
The code on github you've linked to uses spaces for indentation, not tabs.
Reply
#3
Awesome. Thanks!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  IndentationError: unexpected indent Grin 3 4,786 May-15-2018, 06:49 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020