-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add benchmark configuration and scripts for convnets. #6056
Conversation
default='NCHW', | ||
help='The data order: (NCHW, NHWC).') | ||
parser.add_argument( | ||
'--device', type=str, default='GPU', help='The data order: (GPU, CPU).') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use "choices" in parser.add_argument.
'--order', | ||
type=str, | ||
default='NCHW', | ||
help='The data order: (NCHW, NHWC).') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Writing this into 'help'? "Only support NCHW order now."
if args.device == 'CPU': | ||
place = fluid.CPUPlace() | ||
else: | ||
place = fluid.GPUPlace(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
place = fluid.CPUPlace() if fluid.CPUPlace() else fluid.GPUPlace(0)
Fix #6008
For the convenience of profiling, we need to add benchmark mode and running scripts.
python benchmark_convnet_model.py
, some time info will be printed out.The usage is: