exp_mnist/options.py [104:122]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                      help='Maximum number of epochs to run training')
  parser.add_argument('--gpu_id', type=int, default=0,
                      help='GPU id to use for training, -1 for CPU')
  #-------------------------------------------------------------------------

  try:
    parsed_args = vars(parser.parse_args())
  except (IOError) as msg:
    parser.error(str(msg))

  # set the cuda environment variable for the gpu to use
  gpu_id = '' if parsed_args['gpu_id'] < 0 else str(parsed_args['gpu_id'])
  print('Using GPU id: %s' % gpu_id)
  os.environ['CUDA_VISIBLE_DEVICES'] = gpu_id

  # pretty print arguments and return
  support.pretty_print_dict(parsed_args)

  return parsed_args
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



exp_vd/options.py [114:132]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                      help='Maximum number of epochs to run training')
  parser.add_argument('--gpu_id', type=int, default=0,
                      help='GPU id to use for training, -1 for CPU')
  #-------------------------------------------------------------------------

  try:
    parsed_args = vars(parser.parse_args())
  except (IOError) as msg:
    parser.error(str(msg))

  # set the cuda environment variable for the gpu to use
  gpu_id = '' if parsed_args['gpu_id'] < 0 else str(parsed_args['gpu_id'])
  print('Using GPU id: %s' % gpu_id)
  os.environ['CUDA_VISIBLE_DEVICES'] = gpu_id

  # pretty print arguments and return
  support.pretty_print_dict(parsed_args)

  return parsed_args
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



