image_output_1.png
from sklearn.model_selection import train_test_split

import torch

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

batch_size = 32
train_photos, val_photos, train_attrs, val_attrs = train_test_split(data, attrs, train_size=0.8, shuffle=False)
print('Training input shape: ', train_photos.shape)
data_tr = torch.utils.data.DataLoader(train_photos, batch_size=batch_size)
data_val = torch.utils.data.DataLoader(val_photos, batch_size=batch_size)