qanastek / HugsVision

HugsVision is a easy to use huggingface wrapper for state-of-the-art computer vision

Home Page:https://pypi.org/project/hugsvision/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add to device here

zihaoz96 opened this issue · comments

pred = self.model(torch.unsqueeze(img, 0))

RuntimeError: module must have its parameters and buffers on device cuda:0 (device_ids[0]) but found one of them on device: cpu

The issue is related to the DataParallel layer at the end of the initialization block for the TorchVision models. Thus, we need to remove the layer to make it working on CPU devices.

Note: Will be merged in the version 0.72

Code edited:

Sources:

Close with the push: 8529361