From 81a881bd79fa1407c79c787f60c45294b53bb040 Mon Sep 17 00:00:00 2001 From: jajupmochi Date: Tue, 4 May 2021 12:18:13 +0200 Subject: [PATCH] [Exp] Update exceptions in fcsp exps. --- .../thesis/graph_kernels/fcsp/run_jobs_compare_fcsp_space.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gklearn/experiments/thesis/graph_kernels/fcsp/run_jobs_compare_fcsp_space.py b/gklearn/experiments/thesis/graph_kernels/fcsp/run_jobs_compare_fcsp_space.py index c608047..9685d12 100644 --- a/gklearn/experiments/thesis/graph_kernels/fcsp/run_jobs_compare_fcsp_space.py +++ b/gklearn/experiments/thesis/graph_kernels/fcsp/run_jobs_compare_fcsp_space.py @@ -210,11 +210,12 @@ def check_task_status(save_dir, *params): # Check if the task is already computed. file_name = os.path.join(save_dir, 'space' + str_task_id + '.pkl') - if os.path.isfile(file_name): - with open(file_name, 'rb') as f: - data = pickle.load(f) - if data['completed']: - return True + if os.path.getsize(file_name) > 0: + if os.path.isfile(file_name): + with open(file_name, 'rb') as f: + data = pickle.load(f) + if data['completed']: + return True return False