Commit 95cdb963 authored by Yuxin Wu's avatar Yuxin Wu

Use ImageNetModel for CAM; fix memory fraction

parent 7538cc66
...@@ -205,6 +205,7 @@ def get_config(model, nr_tower): ...@@ -205,6 +205,7 @@ def get_config(model, nr_tower):
ScheduledHyperParamSetter('learning_rate', ScheduledHyperParamSetter('learning_rate',
[(0, 0.5), (max_iter, 0)], [(0, 0.5), (max_iter, 0)],
interp='linear', step_based=True), interp='linear', step_based=True),
EstimatedTimeLeft()
] ]
infs = [ClassificationError('wrong-top1', 'val-error-top1'), infs = [ClassificationError('wrong-top1', 'val-error-top1'),
ClassificationError('wrong-top5', 'val-error-top5')] ClassificationError('wrong-top5', 'val-error-top5')]
......
...@@ -22,7 +22,10 @@ def get_default_sess_config(mem_fraction=0.99): ...@@ -22,7 +22,10 @@ def get_default_sess_config(mem_fraction=0.99):
You can modify the returned config to fit your needs. You can modify the returned config to fit your needs.
Args: Args:
mem_fraction(float): fraction of memory to use. mem_fraction(float): see the `per_process_gpu_memory_fraction` option
in TensorFlow's GPUOptions protobuf:
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/protobuf/config.proto
Returns: Returns:
tf.ConfigProto: the config to use. tf.ConfigProto: the config to use.
""" """
...@@ -36,7 +39,7 @@ def get_default_sess_config(mem_fraction=0.99): ...@@ -36,7 +39,7 @@ def get_default_sess_config(mem_fraction=0.99):
# TF benchmark use cpu_count() - gpu_thread_count(), e.g. 80 - 8 * 2 # TF benchmark use cpu_count() - gpu_thread_count(), e.g. 80 - 8 * 2
# Didn't see much difference. # Didn't see much difference.
conf.gpu_options.per_process_gpu_memory_fraction = 0.99 conf.gpu_options.per_process_gpu_memory_fraction = mem_fraction
# This hurt performance of large data pipeline: # This hurt performance of large data pipeline:
# https://github.com/tensorflow/benchmarks/commit/1528c46499cdcff669b5d7c006b7b971884ad0e6 # https://github.com/tensorflow/benchmarks/commit/1528c46499cdcff669b5d7c006b7b971884ad0e6
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment