简体   繁体   中英

Transfer learning with inception model in Tensorflow (python)

How can I load a .pb protobuf model and then tweak the network as needed (specially the outer layers) in order to train a new model for completely different classes? Effectively doing transfer learning?

I want to do something like these (ie train the outer layers with a bigger learning rate than the inner layers) among other things, so I need a way to not only load the graph with the variables, but to alter the network's structure and hyperparameters too.

If anyone has an example to follow with the inception model, it would be amazing!

My question is very similar to this one .

I've searched all over the internet (TF docs, Github, StackOverflow, Google...) but I can't seam to find something useful for a novice.

Thanks a lot!

tf.import_graph_def() is the function for loading a GraphDef:

https://www.tensorflow.org/versions/0.6.0/api_docs/python/framework.html#import_graph_def

Hopefully once imported, you can make the modifications to the graph you need. It would be easier, though, to modify the Python code that generated the graph in the first place, if you have access to that.

This is the updated tutorial from official Tensorflow website https://www.tensorflow.org/hub/tutorials/image_retraining

They use the pre trained Inception V3 model and everything works fine. You can change the dataset folder to your own dataset

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM