Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
c03c27bf
Commit
c03c27bf
authored
Jul 07, 2017
by
Neal Wu
Committed by
GitHub
Jul 07, 2017
Browse files
Merge pull request #1895 from derekjchow/master
Add slim/scripts/finetune_inception_resnet_v2_on_flowers.sh
parents
a75dcd5b
a57bd8eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
97 additions
and
2 deletions
+97
-2
slim/scripts/finetune_inception_resnet_v2_on_flowers.sh
slim/scripts/finetune_inception_resnet_v2_on_flowers.sh
+95
-0
slim/scripts/finetune_inception_v3_on_flowers.sh
slim/scripts/finetune_inception_v3_on_flowers.sh
+1
-1
slim/scripts/train_cifarnet_on_cifar10.sh
slim/scripts/train_cifarnet_on_cifar10.sh
+1
-1
No files found.
slim/scripts/finetune_inception_resnet_v2_on_flowers.sh
0 → 100644
View file @
c03c27bf
#!/bin/bash
#
# This script performs the following operations:
# 1. Downloads the Flowers dataset
# 2. Fine-tunes an Inception Resnet V2 model on the Flowers training set.
# 3. Evaluates the model on the Flowers validation set.
#
# Usage:
# cd slim
# ./slim/scripts/finetune_inception_resnet_v2_on_flowers.sh
set
-e
# Where the pre-trained Inception Resnet V2 checkpoint is saved to.
PRETRAINED_CHECKPOINT_DIR
=
/tmp/checkpoints
# Where the pre-trained Inception Resnet V2 checkpoint is saved to.
MODEL_NAME
=
inception_resnet_v2
# Where the training (fine-tuned) checkpoint and logs will be saved to.
TRAIN_DIR
=
/tmp/flowers-models/
${
MODEL_NAME
}
# Where the dataset is saved to.
DATASET_DIR
=
/tmp/flowers
# Download the pre-trained checkpoint.
if
[
!
-d
"
$PRETRAINED_CHECKPOINT_DIR
"
]
;
then
mkdir
${
PRETRAINED_CHECKPOINT_DIR
}
fi
if
[
!
-f
${
PRETRAINED_CHECKPOINT_DIR
}
/
${
MODEL_NAME
}
.ckpt
]
;
then
wget http://download.tensorflow.org/models/inception_resnet_v2_2016_08_30.tar.gz
tar
-xvf
inception_resnet_v2_2016_08_30.tar.gz
mv
inception_resnet_v2.ckpt
${
PRETRAINED_CHECKPOINT_DIR
}
/
${
MODEL_NAME
}
.ckpt
rm
inception_resnet_v2_2016_08_30.tar.gz
fi
# Download the dataset
python download_and_convert_data.py
\
--dataset_name
=
flowers
\
--dataset_dir
=
${
DATASET_DIR
}
# Fine-tune only the new layers for 1000 steps.
python train_image_classifier.py
\
--train_dir
=
${
TRAIN_DIR
}
\
--dataset_name
=
flowers
\
--dataset_split_name
=
train
\
--dataset_dir
=
${
DATASET_DIR
}
\
--model_name
=
${
MODEL_NAME
}
\
--checkpoint_path
=
${
PRETRAINED_CHECKPOINT_DIR
}
/
${
MODEL_NAME
}
.ckpt
\
--checkpoint_exclude_scopes
=
InceptionResnetV2/Logits,InceptionResnetV2/AuxLogits
\
--trainable_scopes
=
InceptionResnetV2/Logits,InceptionResnetV2/AuxLogits
\
--max_number_of_steps
=
1000
\
--batch_size
=
32
\
--learning_rate
=
0.01
\
--learning_rate_decay_type
=
fixed
\
--save_interval_secs
=
60
\
--save_summaries_secs
=
60
\
--log_every_n_steps
=
10
\
--optimizer
=
rmsprop
\
--weight_decay
=
0.00004
# Run evaluation.
python eval_image_classifier.py
\
--checkpoint_path
=
${
TRAIN_DIR
}
\
--eval_dir
=
${
TRAIN_DIR
}
\
--dataset_name
=
flowers
\
--dataset_split_name
=
validation
\
--dataset_dir
=
${
DATASET_DIR
}
\
--model_name
=
${
MODEL_NAME
}
# Fine-tune all the new layers for 500 steps.
python train_image_classifier.py
\
--train_dir
=
${
TRAIN_DIR
}
/all
\
--dataset_name
=
flowers
\
--dataset_split_name
=
train
\
--dataset_dir
=
${
DATASET_DIR
}
\
--model_name
=
${
MODEL_NAME
}
\
--checkpoint_path
=
${
TRAIN_DIR
}
\
--max_number_of_steps
=
500
\
--batch_size
=
32
\
--learning_rate
=
0.0001
\
--learning_rate_decay_type
=
fixed
\
--save_interval_secs
=
60
\
--save_summaries_secs
=
60
\
--log_every_n_steps
=
10
\
--optimizer
=
rmsprop
\
--weight_decay
=
0.00004
# Run evaluation.
python eval_image_classifier.py
\
--checkpoint_path
=
${
TRAIN_DIR
}
/all
\
--eval_dir
=
${
TRAIN_DIR
}
/all
\
--dataset_name
=
flowers
\
--dataset_split_name
=
validation
\
--dataset_dir
=
${
DATASET_DIR
}
\
--model_name
=
${
MODEL_NAME
}
slim/scripts/finetune_inception_v3_on_flowers.sh
View file @
c03c27bf
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#
#
# Usage:
# Usage:
# cd slim
# cd slim
# ./slim/scripts/finetune_inceptionv3_on_flowers.sh
# ./slim/scripts/finetune_inception
_
v3_on_flowers.sh
set
-e
set
-e
# Where the pre-trained InceptionV3 checkpoint is saved to.
# Where the pre-trained InceptionV3 checkpoint is saved to.
...
...
slim/scripts/train_cifarnet_on_cifar10.sh
View file @
c03c27bf
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#
#
# Usage:
# Usage:
# cd slim
# cd slim
# ./scripts/train_cifar
_
net_on_
mnist
.sh
# ./scripts/train_cifarnet_on_
cifar10
.sh
set
-e
set
-e
# Where the checkpoint and logs will be saved to.
# Where the checkpoint and logs will be saved to.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment