asyml / texar-pytorch

Integrating the Best of TF into PyTorch, for Machine Learning, Natural Language Processing, and Text Generation. This is part of the CASL project: http://casl-project.ai/
https://asyml.io
Apache License 2.0
745 stars 117 forks source link

A logging bug in executor after close_files #322

Closed hunterhector closed 4 years ago

hunterhector commented 4 years ago

The Problem

Executor will call close_files in some cases, and it will see the self._log_destination list to be empty.

If we call _open_files afterward, which assumes the self._log_destination to be of the same length as self.log_destination. This will raise an IndexError.

Possible Fix

Either change the close_file logic to make sure the list won't be zero or change the _open_files logic to make sure the we recreate the list to avoid IndexError