fix reader hang for mulit-cards training
@@ -140,7 +140,8 @@ def get_file_list(params):
full_lines = shuffle_lines(full_lines, params["shuffle_seed"])
# use only partial data for each trainer in distributed training
- full_lines = full_lines[trainer_id::trainers_num]
+ img_per_trainer = len(full_lines) // trainers_num
+ full_lines = full_lines[trainer_id::trainers_num][:img_per_trainer]
return full_lines
