batch_x=[1,2,3,4,5,6,7,8,9]
indices = np.random.permutation(len(batch_x))
batch_x = batch_x[indices]
发生错误:TypeError:only integer scalar arrays can be converted to a scalar index
修改为:
indices = np.random.permutation(np.arange(len(batch_x)))
batch_x = np.array(batch_x)[indices]
batch_y = np.array(batch_y)[indices]
batch_label = np.array(batch_label)[indices]