/AppleInternal/Library/BuildRoots/b6051351-c030-11ec-96e9-3e7866fcf3a1/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShadersGraph/mpsgraph/MetalPerformanceShadersGraph/Runtimes/MPSRuntime/Operations/GPUConv2DOps.mm:214: failed assertion `Source and weight input channels mismatch'
and then the program quit.
it also continuous showed me that:
anaconda3/envs/Unet/lib/python3.8/site-packages/torch/amp/autocast_mode.py:198: UserWarning: User provided device_type of 'cuda', but CUDA is not available. Disabling
warnings.warn('User provided device_type of \'cuda\', but CUDA is not available. Disabling')
What’s wrong with this. How can I solve it. Thank you.
Are you using AMP? It does not support mps right now I’m afraid (We didn’t had time to work on that yet).
Also the channel mismatch error seems unrelated to mps. Do you get the same thing if you run on CPU?
Yes, I’m using the amp. Really thankful for your contribution.
Maybe there’s something with my code, I didn’t get the mismatch error when I used the device “cpu”
I am getting this same error. As far as I’m aware I’m not using AMP. I do not get the same error if I run on CPU, everything runs fine until I use MPS with 2D convolution.
data = torch.tensor(np.random.uniform(size=(1, 1, 10, 10)), dtype=torch.float32).to(device)
optimizer = torch.optim.Adam(conv.parameters(), lr=0.1)
x = data
out = torch.sum(conv(x))
loss = torch.nn.MSELoss()(out, torch.zeros_like(out))
optimizer.zero_grad()
out.backward()
optimizer.step()