1 Star 0 Fork 11

sallysun888/TensorFlow-Course

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Convolutional Neural Network

This is the code repository for the blog post Train a Convolutional Neural Network as a Classifier. Please refer to this wiki page for more details.

Training

Train:

The training can be run using the train.sh bash script file using the following command:

./train.sh

The bash script is as below:

python train_classifier.py \
  --batch_size=512 \
  --max_num_checkpoint=10 \
  --num_classes=10 \
  --num_epochs=1 \
  --initial_learning_rate=0.001 \
  --num_epochs_per_decay=1 \
  --is_training=True \
  --allow_soft_placement=True \
  --fine_tuning=False \
  --online_test=True \
  --log_device_placement=False

helper:

In order to realize that what are the parameters as input running the following command is recommended:

python train_classifier.py --help

In which train_classifier.py is the main file for running the training. The result of the above command will be as below:

--train_dir TRAIN_DIR
                      Directory where event logs are written to.
--checkpoint_dir CHECKPOINT_DIR
                      Directory where checkpoints are written to.
--max_num_checkpoint MAX_NUM_CHECKPOINT
                      Maximum number of checkpoints that TensorFlow will
                      keep.
--num_classes NUM_CLASSES
                      Number of model clones to deploy.
--batch_size BATCH_SIZE
                      Number of model clones to deploy.
--num_epochs NUM_EPOCHS
                      Number of epochs for training.
--initial_learning_rate INITIAL_LEARNING_RATE
                      Initial learning rate.
--learning_rate_decay_factor LEARNING_RATE_DECAY_FACTOR
                      Learning rate decay factor.
--num_epochs_per_decay NUM_EPOCHS_PER_DECAY
                      Number of epoch pass to decay learning rate.
--is_training [IS_TRAINING]
                      Training/Testing.
--fine_tuning [FINE_TUNING]
                      Fine tuning is desired or not?.
--online_test [ONLINE_TEST]
                      Fine tuning is desired or not?.
--allow_soft_placement [ALLOW_SOFT_PLACEMENT]
                      Automatically put the variables on CPU if there is no
                      GPU support.
--log_device_placement [LOG_DEVICE_PLACEMENT]
                      Demonstrate which variables are on what device.

Evaluation

The evaluation will be run using the evaluation.sh bash script file using the following command:

./evaluation.sh
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/sallysun888/TensorFlow-Course.git
git@gitee.com:sallysun888/TensorFlow-Course.git
sallysun888
TensorFlow-Course
TensorFlow-Course
master

搜索帮助

371d5123 14472233 46e8bd33 14472233