Skip to content
Snippets Groups Projects
Commit 3aafb6ac authored by Paul Best's avatar Paul Best
Browse files

use cuda from argparse

parent 62192dcc
No related branches found
No related tags found
No related merge requests found
......@@ -60,7 +60,7 @@ class Dataset(torch.utils.data.Dataset):
model = models.get[args.specie]['archi']
model.load_state_dict(torch.load(f"{os.path.dirname(__file__)}/weights/{models.get[args.specie]['weights']}"))
model.eval()
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
device = torch.device(f'cuda:{args.cuda}' if torch.cuda.is_available() else 'cpu')
model.to(device)
# prepare data loader and output storage for predictions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment