tensorflow_alexnet_classify (details http://www.cnblogs.com/vipyoumay/p/7686230.html)
This repository aims to implement a alexnet with tensorflow. The train file contains 25000 images (cat and dog). We built this AlexNet in Windows , it's very convenient for most of you to train the net.
1' Make sure that you have already changed file directory to the right format.
example:
/path/to/train/cat/cat_1.jpg
/path/to/train/cat/cat_2.jpg
/path/to/train/dog/dog_1.jpg
/path/to/train/dog/dog_2.jpg
/path/to/test/cat/cat_1.jpg
/path/to/test/dog/dog_1.jpg
2' Modify parameters of the beginning of main function in the main_alexnet.py file.
example:
learning_rate = 1e-3
num_epochs = 17
train_batch_size = 1000
test_batch_size = 100
dropout_rate = 0.5
num_classes = 2
display_step = 2
filewriter_path = "./tmp/tensorboard"
checkpoint_path = "./tmp/checkpoints"
image_format = 'jpg'
file_name_of_class = ['cat',
'dog']
train_dataset_paths = ['G:/Lab/Data_sets/catanddog/train/cat/',
'G:/Lab/Data_sets/catanddog/train/dog/']
test_dataset_paths = ['G:/Lab/Data_sets/catanddog/test/cat/',
'G:/Lab/Data_sets/catanddog/test/dog/']
We choosed ten pictures from the internet to validate the AlexNet, there were three being misidentified, the accuracy is about 70%, which is similar to the accuracy we tested before. But, On the whole, the AlexNet is not as good as we expected, the reason may have something to do with the datesets. If you have more than One hundred thousand dataset, the accuracy must be better than we trained. See the results below: