Skip to content
This repository has been archived by the owner on Feb 18, 2023. It is now read-only.

Commit

Permalink
Drop plots as they might cause tkinter crashes
Browse files Browse the repository at this point in the history
The following exception has already occured a couple of times:
Exception ignored in: <function Image.__del__ at 0x7fe33a287dc0>
Traceback (most recent call last):
  File "/home/corp.cyren.com/jclement/.pyenv/versions/3.8.7/lib/python3.8/tkinter/__init__.py",
  line 4020, in __del__
RuntimeError: main thread is not in main loop

Searching for a cause of this error led me to this result:
r9y9/deepvoice3_pytorch#5
It suggest that matplotlib might be causing this. Therefore the plotting
of the scores is removed from this script. It can still easily be done
with the visualize-results scripts.
  • Loading branch information
Joris Clement committed Mar 6, 2021
1 parent 40a6022 commit 33faa4d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
7 changes: 0 additions & 7 deletions src/thesis/classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
from .metrics import avg_file_scores, file_scores, top_k_accuracy_score
from .models import is_model_finger, ModelHandler
from .prepared_data import adapt_durations, extract_features, MeasurementNormalizer
from .visualize_results import plot_scores

SEED: Final = 23
random.seed(SEED)
Expand Down Expand Up @@ -455,12 +454,6 @@ def _finish(self):
].mean(axis=1)
)
self.finished = True
description = (
f"cv: {len(self.cv_splits)}"
f", n: {len(self.y)}"
f", n_defects: {len(self.defects)}"
)
plot_scores(self.scores, self.config, self.output_dir, description=description)


@click.command()
Expand Down
3 changes: 0 additions & 3 deletions tests/test_classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ def test_classify_main(config, tmpdir):
result = runner.invoke(classify.main, [str(config_filepath)])

assert result.exit_code == 0
assert Path(config["general"]["output_dir"], "val_balanced_accuracy.svg").exists()
assert Path(config["general"]["output_dir"], "val_accuracy.svg").exists()
assert Path(config["general"]["output_dir"], "val_top_3_accuracy.svg").exists()


def test_classify_ClassificationHandler_with_saving(
Expand Down

0 comments on commit 33faa4d

Please sign in to comment.