/data/Flicker8k_reshaped"train = np.array([np.array(Image.open(loc+"/"+fname)) for fname in train_filenames])([np.array(Image.open(loc+"/"+fname)) for fname in train
import numpy as npa = np.array([1, 2, 6, 4, 2, 3, 2])for i, x in enumerate(a):第二种选择是无效的,因为它需要多次遍历数组:a = np.array4, 2, 3, 2])for x in np.unique(a):
inv[x] = np.flatn