My objective is to "add" more classes to the existing 1000 Imagenet classes that came with Tensorflow Inception. Now I could just re-run the whole thing by training from scratch using bazel-bin/inception/imagenet_train
but that would take a long time especially each time I want to add a new class.
Is it possible to use bazel-bin/tensorflow/examples/image_retraining/retrain --image_dir ~/flower_photos
but then add to the existing label output file?
Sorry I am a newbie.
In theory all you'll need to do is point it at a set of sub-folders, each named after one of your categories and containing only images from that category. If you do that and pass the root folder of the subdirectories as the argument to --image_dir , the script should train just like it did for the flowers.
You could brazenly add a second last layer, that also refers to the second to last layer... Of course, that's kind of a hack and not practical if you wanna do the procedure multiple times...
Alternatively, you replace the output layer and before you do that, you save the previous weights for that layer manually and, then reload the whole net with something like this optimistic restore and add the old weights, that you also have to reload separately, to your now bigger weight-matrix manually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With