@@ -58,15 +58,20 @@ def get_predictions(dir_path, dir_path_list, include_num_runs,
5858 match = model_and_automl_re .search (model_name )
5959 automl_seed = int (match .group (1 ))
6060 num_run = int (match .group (2 ))
61+
62+ if model_name .endswith ("/" ):
63+ model_name = model_name [:- 1 ]
64+ basename = os .path .basename (model_name )
65+
6166 if (automl_seed , num_run ) in include_num_runs :
6267 if precision == "16" :
63- predictions = np .load (os .path .join (dir_path , model_name )).astype (dtype = np .float16 )
68+ predictions = np .load (os .path .join (dir_path , basename )).astype (dtype = np .float16 )
6469 elif precision == "32" :
65- predictions = np .load (os .path .join (dir_path , model_name )).astype (dtype = np .float32 )
70+ predictions = np .load (os .path .join (dir_path , basename )).astype (dtype = np .float32 )
6671 elif precision == "64" :
67- predictions = np .load (os .path .join (dir_path , model_name )).astype (dtype = np .float64 )
72+ predictions = np .load (os .path .join (dir_path , basename )).astype (dtype = np .float64 )
6873 else :
69- predictions = np .load (os .path .join (dir_path , model_name ))
74+ predictions = np .load (os .path .join (dir_path , basename ))
7075 result .append (predictions )
7176 return result
7277
@@ -249,7 +254,10 @@ def main(autosklearn_tmp_dir,
249254 dir_ensemble_list_mtimes = []
250255
251256 for dir_ensemble_file in dir_ensemble_list :
252- dir_ensemble_file = os .path .join (dir_ensemble , dir_ensemble_file )
257+ if dir_ensemble_file .endswith ("/" ):
258+ dir_ensemble_file = dir_ensemble_file [:- 1 ]
259+ basename = os .path .basename (dir_ensemble_file )
260+ dir_ensemble_file = os .path .join (dir_ensemble , basename )
253261 mtime = os .path .getmtime (dir_ensemble_file )
254262 dir_ensemble_list_mtimes .append (mtime )
255263
@@ -285,14 +293,18 @@ def main(autosklearn_tmp_dir,
285293
286294 model_idx = 0
287295 for model_name in dir_ensemble_list :
296+ if model_name .endswith ("/" ):
297+ model_name = model_name [:- 1 ]
298+ basename = os .path .basename (model_name )
299+
288300 if precision is "16" :
289- predictions = np .load (os .path .join (dir_ensemble , model_name )).astype (dtype = np .float16 )
301+ predictions = np .load (os .path .join (dir_ensemble , basename )).astype (dtype = np .float16 )
290302 elif precision is "32" :
291- predictions = np .load (os .path .join (dir_ensemble , model_name )).astype (dtype = np .float32 )
303+ predictions = np .load (os .path .join (dir_ensemble , basename )).astype (dtype = np .float32 )
292304 elif precision is "64" :
293- predictions = np .load (os .path .join (dir_ensemble , model_name )).astype (dtype = np .float64 )
305+ predictions = np .load (os .path .join (dir_ensemble , basename )).astype (dtype = np .float64 )
294306 else :
295- predictions = np .load (os .path .join (dir_ensemble , model_name ))
307+ predictions = np .load (os .path .join (dir_ensemble , basename ))
296308 score = calculate_score (targets_ensemble , predictions ,
297309 task_type , metric ,
298310 predictions .shape [1 ])
0 commit comments