SENet-Tensorflow
SENet-Tensorflow copied to clipboard
new dataset
@taki0112 I want to train new dataset with this model, must I resize the image to 32*32?
I have the same question as you,have you found way to train own pictures dataset? @HanYuanyuaner
me too
you could change prepare_data function to load your own dataset.
def prepare_data(): print("======Loading data======") traindata_dir = 'e:/train/' #change your traindata_dir testdata_dir = 'e:/test/' #change your testdata_dir image_dim = image_size * image_size * img_channels label_names = ['cardboard','glass','metal','trash','paper','plastic'] #change your classes label_count = len(label_names) train_files = [traindata_dir+s for s in label_names] test_files = [testdata_dir+s for s in label_names] train_data, train_labels = load_data(train_files, traindata_dir, label_count) test_data, test_labels = load_data(test_files, testdata_dir, label_count)
print("Train data:", np.shape(train_data), np.shape(train_labels))
print("Test data :", np.shape(test_data), np.shape(test_labels))
print("======Load finished======")
print("======Shuffling data======")
indices = np.random.permutation(len(train_data))
train_data = train_data[indices]
train_labels = train_labels[indices]
indices = np.random.permutation(len(test_data))
test_data = test_data[indices]
test_labels = test_labels[indices]
print("======Prepare Finished======")
return train_data, train_labels, test_data, test_labels
or you can train and test ratio to generate trainfile and testflie list then load.