Skip to content

Device = cuda ———> in Colab not working #1606

Closed Answered by ericspod
Alisoltan82 asked this question in Q&A
Discussion options

You must be logged in to vote

This may be because the weights were stored with a certain device that isn't the exact one you're using. Can you try:

model = config.get_parsed_content("network").to("cpu")
model.load_state_dict(torch.load(model_path, map_location="cpu"))
model=model.to(device)

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@Alisoltan82
Comment options

Comment options

You must be logged in to vote
2 replies
@Alisoltan82
Comment options

@ericspod
Comment options

Answer selected by ericspod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants