diff --git a/core/utils/dataset_holder.py b/core/utils/dataset_holder.py index 66e1edb2c1d3db9359b95229a474cae2301d7d2f..9b8a3d9f391dd51b39a19f99497893a485f3fb4c 100755 --- a/core/utils/dataset_holder.py +++ b/core/utils/dataset_holder.py @@ -157,8 +157,9 @@ class TimeSplitDatasetHolder(DatasetHolder): if postfix.isdigit(): if int(postfix) % node_num == node_idx: data_file_list.append(sub_file) - elif hash(sub_file_name) % node_num == node_idx: - data_file_list.append(sub_file) + else: + if hash(sub_file_name) % node_num == node_idx: + data_file_list.append(sub_file) time_window_mins = time_window_mins - self._split_interval data_time = data_time + datetime.timedelta( minutes=self._split_interval) diff --git a/core/utils/envs.py b/core/utils/envs.py index fe54297995e442063503e2911a895251a95b7365..dffc069ac7cfff7dd6f39c0266f84caf36f8b6c1 100755 --- a/core/utils/envs.py +++ b/core/utils/envs.py @@ -18,6 +18,7 @@ import copy import os import socket import sys +import traceback global_envs = {} @@ -172,7 +173,9 @@ def lazy_instance_by_package(package, class_name): globals(), locals(), package.split(".")) instance = getattr(model_package, class_name) return instance - except Exception,err: + except Exception, err: + traceback.print_exc() + print('Catch Exception:%s' % str(err)) return None @@ -187,7 +190,9 @@ def lazy_instance_by_fliename(abs, class_name): globals(), locals(), package.split(".")) instance = getattr(model_package, class_name) return instance - except Exception,err: + except Exception, err: + traceback.print_exc() + print('Catch Exception:%s' % str(err)) return None