Skip to content
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 --cuda_id parameter #77

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SinGAN/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ def generate_dir2save(opt):

def post_config(opt):
# init fixed parameters
os.environ["CUDA_VISIBLE_DEVICES"] = str(opt.cuda_id)
opt.device = torch.device("cpu" if opt.not_cuda else "cuda:0")
opt.niter_init = opt.niter
opt.noise_amp_init = opt.noise_amp
Expand Down
1 change: 1 addition & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def get_arguments():
#parser.add_argument('--mode', help='task to be done', default='train')
#workspace:
parser.add_argument('--not_cuda', action='store_true', help='disables cuda', default=0)
parser.add_argument('--cuda_id', help='the cuda id of the GPU to train on',default='0')

#load, input, save configurations:
parser.add_argument('--netG', default='', help="path to netG (to continue training)")
Expand Down