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

Passing Model to CUDA #5

Open
mtd7 opened this issue Feb 11, 2023 · 0 comments
Open

Passing Model to CUDA #5

mtd7 opened this issue Feb 11, 2023 · 0 comments

Comments

@mtd7
Copy link

mtd7 commented Feb 11, 2023

Hello,

I've been working on trying to get your model to work as part of my Master's Dissertation and I've found some code that may no longer be up to date. net.cuda() didn't seem to be able to find my GPU; but I passed it with the code below and it seems to work...

net = make_model(n_classes=345, coord_input_dim=2, feat_input_dim=2, feat_dict_size=103, 
                 n_layers=network_configs['n_layers'], n_heads=network_configs['n_heads'], 
                 embed_dim=network_configs['embed_dim'], feedforward_dim=network_configs['feed_forward_hidden'], 
                 normalization=network_configs['normalization'], dropout=network_configs['dropout'], mlp_classifier_dropout=network_configs['mlp_classifier_dropout'])
#net = net.cuda()
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
net = net.to(device)

This pattern in general needs to be repeated every where the .cuda() method is used...

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant