machrisaa / tensorflow-vgg

VGG19 and VGG16 on Tensorflow
2.21k stars 1.08k forks source link

Fine-tune the model #21

Closed CodeMonkey-GH closed 7 years ago

CodeMonkey-GH commented 7 years ago

Hi, I'm trying to use vgg19 on my problem which is a two-class classification, so I want to fine-tune the model on my dataset and I have modified the 'fc8' layer in ''vgg19_trainable.py''(in-size:4096, out-size:2). I want to set the batch-size to be 32, so should I first read and reshape the 32 images and use 'np.concatenate()' to combine the images, just like the code in the 'test_vgg10.py'? And I think the label-list for each batch is a list type which contains 32 1-hot label(each label is also a list type), am I doing right?

machrisaa commented 7 years ago

Hi @CodeMonkey-GH, yes I think you are right. A little trick you may use is that you can replace np.concatenate() by putting those images into a list and that will also work.