Skip to content

Commit

Permalink
refine scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Flowingsun007 committed Sep 7, 2020
1 parent 156239e commit 7649516
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
19 changes: 9 additions & 10 deletions Classification/cnns/evaluate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
rm -rf core.*

# Set up dataset root dir
DATA_ROOT=/dataset/ImageNet/ofrecord
DATA_ROOT=/datasets/ImageNet/ofrecord

# Set up model path, e.g. : vgg16_of_best_model_val_top1_721 alexnet_of_best_model_val_top1_54762
MODEL_LOAD_DIR="resnet_v15_of_best_model_val_top1_77318"
Expand All @@ -20,20 +20,19 @@ MODEL_LOAD_DIR="resnet_v15_of_best_model_val_top1_77318"
--model="resnet50"


# # # Validatation on imagenet
# DATA_ROOT=/datasets/ImageNet/ofrecord

# # Set up model path, e.g. : output/snapshots/model_save-20200831131226/snapshot_epoch_9
# MODEL_LOAD_DIR="saved_models/snapshots/model_save-20200905093837/snapshot_epoch_89"

# python3 of_cnn_evaluate.py \
# # Evaluate with mini-imagenet
# DATA_ROOT=data/mini-imagenet/ofrecord
# MODEL_LOAD_DIR="output/snapshots/model_save-20200907130848/snapshot_epoch_9"
# python3 of_cnn_evaluate.py \
# --num_epochs=3 \
# --num_val_examples=50000 \
# --num_val_examples=50 \
# --model_load_dir=$MODEL_LOAD_DIR \
# --val_data_dir=$DATA_ROOT/validation \
# --val_data_part_num=256 \
# --val_data_part_num=1 \
# --num_nodes=1 \
# --node_ips='127.0.0.1' \
# --gpu_num_per_node=8 \
# --val_batch_size_per_device=100 \
# --gpu_num_per_node=1 \
# --val_batch_size_per_device=10 \
# --model="resnet50"
7 changes: 4 additions & 3 deletions Classification/cnns/train.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
rm -rf core.*
rm -rf ./output/snapshots/*


# training with synthetic data
python3 of_cnn_train_val.py \
--num_examples=50 \
--num_val_examples=50 \
--num_nodes=1 \
--gpu_num_per_node=1 \
--optimizer="sgd" \
--momentum=0.875 \
--optimizer="adam" \
--learning_rate=0.001 \
--loss_print_every_n_iter=1 \
--batch_size_per_device=16 \
Expand All @@ -19,6 +19,7 @@ python3 of_cnn_train_val.py \




# # training with mini-imagenet
# DATA_ROOT=data/mini-imagenet/ofrecord
# python3 of_cnn_train_val.py \
Expand Down Expand Up @@ -48,7 +49,7 @@ python3 of_cnn_train_val.py \
# mkdir -p $LOG_FOLDER
# LOGFILE=$LOG_FOLDER/resnet_training.log

# python3 of_cnn_train_val_new.py \
# python3 of_cnn_train_val.py \
# --train_data_dir=$DATA_ROOT/train \
# --train_data_part_num=256 \
# --val_data_dir=$DATA_ROOT/validation \
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
numpy>=1.17.2
pandas>=1.0.4
pandas>=1.0.4
pillow>=7.2.0

0 comments on commit 7649516

Please sign in to comment.