TensorFlow benchmarks指令碼中命令引數必須加“=”
阿新 • • 發佈:2019-02-03
=====================================================
在TensorFlow benchmarks測試時一直使用的是“--flag value”的形式,在我的印象中這樣也是可以的,將value的值賦給flag,但是benchmarks中的幾個引數用這種方式設定不能成功,比如“distortions”這個引數,預設為True,在命令列中設定為--distortions False”後仍然為True。
將問題提交到GitHub後,他們提出會加一個引數檢驗過程,但是,為保險起見,以後所有的flag均使用“--flag=value”的形式設定。
目前我找到的不能成功設定的有三個:“distortions
以下為驗證過程:
1. 列印預設引數
# python tf_cnn_benchmarks.py ======model: trivial ======batch_size: 0 ======data_name: None ======data_dir: None ======variable_update: parameter_server ======local_parameter_device: gpu ======all_reduce_spec: None ======batch_group_size: 1 ======xla: False ======staged_vars: False ======num_inter_threads: 52 ======num_intra_threads: 1 ======resize_method: bilinear ======distortions: True ======use_datasets: True ======optimizer: momentum ======winograd_nonfused: True ======agg_small_grads_max_bytes: 0 ======enable_layout_optimizer: False
2. 修改其中部分引數,以“--flag value”的形式
python tf_cnn_benchmarks.py \ --num_batches 100 --display_every 1 \ --num_gpus 8 \ --model resnet50 --batch_size 128 \ --data_name imagenet --data_dir /data0/imagenet_data \ --variable_update replicated --all_reduce_spec pscpu --local_parameter_device cpu \ --agg_small_grads_max_bytes 1024 \ --batch_group_size 4 --num_inter_threads 24 \ --optimizer momentum --distortions False \ --xla True --use_datasets False \ --winograd_nonfused False --enable_layout_optimizer True --resize_method nearest
打印出來為
======model: resnet50
======batch_size: 128
======data_name: imagenet
======data_dir: /data0/imagenet_data
======variable_update: replicated
======local_parameter_device: cpu
======all_reduce_spec: pscpu
======batch_group_size: 4
======xla: True
======staged_vars: False
======num_inter_threads: 24
======num_intra_threads: 1
======resize_method: nearest
======distortions: True # error
======use_datasets: True # error
======optimizer: momentum
======winograd_nonfused: True # error
======agg_small_grads_max_bytes: 1024
======enable_layout_optimizer: True
3. 改為“--flag=value”的形式
python tf_cnn_benchmarks.py \
--num_batches=100 --display_every=1 \
--num_gpus=8 \
--model=resnet50 --batch_size=128 \
--data_name=imagenet --data_dir=/data0/imagenet_data \
--variable_update=replicated --all_reduce_spec=pscpu --local_parameter_device=cpu \
--agg_small_grads_max_bytes=1024 \
--batch_group_size=4 --num_inter_threads=24 \
--optimizer=momentum --distortions=False \
--xla=True --use_datasets=False \
--winograd_nonfused=False --enable_layout_optimizer=True --resize_method=nearest
打印出來為
======model: resnet50
======batch_size: 128
======data_name: imagenet
======data_dir: /data0/imagenet_data
======variable_update: replicated
======local_parameter_device: cpu
======all_reduce_spec: pscpu
======batch_group_size: 4
======xla: True
======staged_vars: False
======num_inter_threads: 24
======num_intra_threads: 1
======resize_method: nearest
======distortions: False
======use_datasets: False
======optimizer: momentum
======winograd_nonfused: False
======agg_small_grads_max_bytes: 1024
======enable_layout_optimizer: True