Python Forum
indent error - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: indent error (/thread-9557.html)



indent error - metalray - Apr-16-2018

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/master/donkeycar/templates/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?


RE: indent error - stranac - Apr-16-2018

The code on github you've linked to uses spaces for indentation, not tabs.


RE: indent error - metalray - Apr-16-2018

Awesome. Thanks!