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

'mps' device is not supported #208

Open
MartinB47 opened this issue Dec 21, 2024 · 0 comments
Open

'mps' device is not supported #208

MartinB47 opened this issue Dec 21, 2024 · 0 comments

Comments

@MartinB47
Copy link

Issue Description
Specifying device='mps' results in the following error.

AssertionError: Input device is not valid, please specify 'cuda' or 'cpu'

To Reproduce

from torchsummary import summary
import torch
import torch.nn as nn

class AddNet(nn.Module):
    def __init__(self):
        super(AddNet, self).__init__()
        self.fc1 = nn.Linear(2, 1, bias=False)

    def forward(self, x):
        return self.fc1(x)

device = torch.device("mps" if torch.backends.mps.is_available() else "cpu")

model = AddNet().to(device)

# Attempt to use summary with MPS device
summary(model, input_size=(1, 2), device="mps")

Additional Information:
The MPS backend is supported in PyTorch 1.12+ on macOS with Apple Silicon chips (like M1 Macbook)

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