Solved by user_123454321 in post #2 
              
              
                Can you try replacing 
train_data_df = df_train[df_train['path'].str[-20:-16].isin(train_users)]
valid_data_df = df_train[df_train['path'].str[-20:-16].isin(validate_users)]

with 
train_data_df = df_train[df_train['path'].str[-20:-16].isin(train_users)].reset_index(drop=True)
valid_data_df = df_tra…