candle icon indicating copy to clipboard operation
candle copied to clipboard

Error: device mismatch in conv2d, lhs: Cpu, rhs: Metal { gpu_id: 4294968713 }

Open lijingrs opened this issue 1 year ago • 3 comments
trafficstars

cargo run --example resnet --release --features metal -- --image test.jpg

image

help to solve this problem! Thanks!

lijingrs avatar Mar 16 '24 07:03 lijingrs

maybe this similar to https://github.com/huggingface/candle/issues/1838

lijingrs avatar Mar 16 '24 10:03 lijingrs

I just pushed a fix for the device mismatch in #1856 but now it's running into the missing metal kernel for max-pool as in #1838.

LaurentMazare avatar Mar 16 '24 21:03 LaurentMazare

Actually the missing maxpool kernel was just added by @tomsanbear in #1863 and now the resnet example properly works on metal.

$ cargo run --example resnet --release  --features metal -- --image ~/Downloads/tiger.jpeg
loaded image Tensor[dims 3, 224, 224; f32, metal:4294968416]
model built
tiger, Panthera tigris  : 89.93%
tiger cat               : 9.68%
zebra                   : 0.22%
jaguar, panther, Panthera onca, Felis onca: 0.06%
tabby, tabby cat        : 0.03%

LaurentMazare avatar Mar 18 '24 07:03 LaurentMazare