keras model.fit_generator训练完一个epoch之后无法加载训练集怎么处理?

1、在训练神经网络的过程中遇到了训练完一个epoch之后无法继续训练的问题,具体问题截图如下

图片说明

数据生成的代码如下

def GET_DATASET_SHUFFLE(train_x, train_y, batch_size):
    #random.shuffle(X_samples)

    batch_num = int(len(train_x) / batch_size)
    max_len = batch_num * batch_size
    X_samples = np.array(train_x[0:max_len])
    Y_samples = np.array(train_y[0:max_len])

    X_batches = np.split(X_samples, batch_num)
    Y_batches = np.split(Y_samples, batch_num)

    for i in range(batch_num):
        x = np.array(list(map(load_image, X_batches[i])))
        y = np.array(list(map(load_label, Y_batches[i])))
        yield x, y 

想要向各位大神请教一下,刚刚接触这个不是太懂

https://blog.csdn.net/xfjjs_net/article/details/84798045