我对图书馆不熟悉。我有图像数据集属于5类,数据集非常不平衡。

我使用tensorflow flow.from目录函数加载图像,并使用smote函数进行重采样。
img_height, img_width = 224,224
# the no. imgaes to load at each iteration
batch_size = 32
# only rescaling
train_datagen = ImageDataGenerator(
rescale=1./255,
zoom_range=0.2,
horizontal_flip=True,
vertical_flip=True
)
test_datagen = ImageDataGenerator(
rescale=1./255,
vertical_flip=True,
zoom_range=0.2,
horizontal_flip=True
)
# these are generators for train/test data that will read pictures #found in the defined subfolders of 'data/'
print('Total number of images for "training":')
train_generator = train_datagen.flow_from_directory(
train_data_dir,
target_size = (img_height, img_width),
batch_size = batch_size,
class_mode = "categorical",shuffle = True
#,color_mode='grayscale'
)
smote = SMOTE()
X_sm, y_sm = smote.fit_resample(train_generator, category_names)细胞开始运行,30到40分钟后,jupyter内核就死了,我没有得到任何结果。请帮助解决这个问题,我有16 GB的GPU,但是smote没有在图像数据集上运行。
https://stackoverflow.com/questions/68351376
复制相似问题