fix bug when _total == 0 in training_models.py