问题 I am reading in a csv file with pandas, and give the column names stored in colname colnames=['file', 'label'] # Read data from file data = pd.read_csv('./Hand_Annotations_2.csv',names=colnames, header=None) # Preview the first 5 lines of the loaded data data.head() Then, I use ImageDataGenerator() and flow_fromdataframe() to get batches of data train_generator=datagen.flow_from_dataframe(dataframe=data, directory=None, x_col=colnames[0], y_col=colnames[1], class_indices=IDmap, class_mode=