diff options
author | Eva Schlinger <eschling@andrew.cmu.edu> | 2013-06-07 14:14:34 -0400 |
---|---|---|
committer | Eva Schlinger <eschling@andrew.cmu.edu> | 2013-06-07 14:14:34 -0400 |
commit | 0a132ca642a39495285e50f0a7ce6ec3566c71a5 (patch) | |
tree | f9e9f05df230aa4be6aa6e275c485b264072ac35 /training/mira | |
parent | ea225c8fcfe7f6260589d7d37c06c41c691603bd (diff) |
don't try to send graph in email if matplotlib import failed
Diffstat (limited to 'training/mira')
-rwxr-xr-x | training/mira/mira.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/training/mira/mira.py b/training/mira/mira.py index 89822d41..f031c313 100755 --- a/training/mira/mira.py +++ b/training/mira/mira.py @@ -271,8 +271,10 @@ def write_report(graph_file, dev_results, dev_bleu, out.close() if args.email: - email_process = subprocess.Popen(['mail', '-s', subject, '-a', - graph_file, args.email], stdin = subprocess.PIPE) + cmd = ['mail', '-s', subject] + if graph_file: + cmd += ['-a', graph_file] + email_process = subprocess.Popen(cmd+[args.email], stdin = subprocess.PIPE) email_process.communicate(message) #feature weights stats for report |