Closed kemaleren closed 1 year ago
That's cool! I know other people have also expressed interest on running on CPU/other devices so this seems like a good addition. I'll just verify that your changes don't break anything first :)
I think it's probably better practice to have device as inputs to functions/properties of nn.Modules rather than defined outside the local scope, but that's a minor issue.
I thought so too, but the PyTorch blog has a section on writing device-agnostic code, that that's what they recommended: https://pytorch.org/blog/pytorch-0_4_0-migration-guide/#writing-device-agnostic-code
Also I'm sure there's things that still won't work. If they need to be fixed I can do that. I made these changes to get the demo_match.py
script working.
I'll merge it and fix any issues later :p
I wanted to test this model on a device with no GPU. Even though it is much slower and would not be a good idea in production, for testing small images it still runs in a reasonable amount of time.