[Python]使用itertools.count来计数训练

2019-03-31  本文已影响0人  VanJordan
# At any point you can hit Ctrl + C to break out of training early.
try:
    for epoch in itertools.count(start=1):
        train()
        if train_step == args.max_step:
            logging('-' * 100)
            logging('End of training')
            break
except KeyboardInterrupt:
    logging('-' * 100)
    logging('Exiting from training early')
上一篇下一篇

猜你喜欢

热点阅读