Closed zihaoz96 closed 2 years ago
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
https://github.com/qanastek/HugsVision/blob/d93cdd15da6fc9fe7f3053ca6e6d4196ef758327/hugsvision/inference/TorchVisionClassifierInference.py#L46