A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/sdemyanov/tensorflow-worklab below:

sdemyanov/tensorflow-worklab: This set of files is an example of how to use Tensorflow for importing and retraining an existing model, such as ResNet. The goal of this example is to separate all functionality on several classes, so it is easy to modify the parameters and run the models, while still having all code not too deep inside.

Copyright (C) 2016 Sergey Demyanov

Email: my_name@my_sirname.net

This set of files is an example of how to use Tensorflow for importing and retraining an existing model, such as ResNet. The goal of this example is to separate all functionality on several classes to make it easy to modify the parameters and run the models, while still having all code not too deep inside.

CLASSES

The following scripts are created for launching:

HOW TO RETRAIN A MODEL

In the Network class you specify your model. You start from defining the primitives (batch_norm, conv_layer, pool_layer, etc), based on that define the main network blocks (such as ResNet blocks), and define the whole network in the _construct function. No need to specify each block explicitly, you can use loops. For each and layer you can specify lr_mult, which is used to adjust the learning rate for this layer. If it is zero, the layer will remain fixed.

Scopes are used to define the variable names, and visualize the graph in Tensorboard. Adjust them for your purpose. In order to find the variable names of an existing model, use the command

python /path/to/tensorflow/tensorflow/python/tools/inspect_checkpoint.py --file_name=/path/to/pretrained_model/model.ckpt

The inspect_checkpoint.py file can be found in './tensorflow/python/tools' folder of the Tensorflow source, which you can download from GitHub.

This script will show you the variable names, their types and sizes. Use the restore parameter in the Network class to specify the variable name in the external model. If you don't specify it (equivalent to restore=True), your own variable name will be used. Set restore=False to initialize the variable from scratch.

Set up the path to the restored model in the training script. For example, use this link to download pretrained ResNet models. A restored model is used only at the start of training. Once the current session is saved (i.e. the checkpoint file exist), all variables are restored from it, unless you specify RESTORE_ANYWAY=True in the Session class. Therefore, you can stop and start training at any time.

POTENTIAL PROBLEMS

sudo pip install --upgrade /path/to/build/build.whl

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4