Skip to content

Commit 0d6e751

Browse files
HOTFIX: Skip casual files in model and ensemble directories / issue-69
1 parent 00927b9 commit 0d6e751

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

autosklearn/ensemble_builder.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ def main(self):
128128
for dir_ensemble_file in dir_ensemble_list:
129129
if dir_ensemble_file.endswith("/"):
130130
dir_ensemble_file = dir_ensemble_file[:-1]
131+
if not dir_ensemble_file.endswith(".npy"):
132+
self.logger.warning('Error loading file (not .npy): %s', dir_ensemble_file)
133+
continue
134+
131135
basename = os.path.basename(dir_ensemble_file)
132136
dir_ensemble_file = os.path.join(dir_ensemble, basename)
133137
mtime = os.path.getmtime(dir_ensemble_file)

autosklearn/util/backend.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ def load_models_by_file_names(self, model_file_names):
179179
# File names are like: {seed}.{index}.model
180180
if model_file.endswith('/'):
181181
model_file = model_file[:-1]
182+
if not model_file.endswith('.model'):
183+
continue
184+
182185
basename = os.path.basename(model_file)
183186

184187
basename_parts = basename.split('.')

0 commit comments

Comments
 (0)