mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-16 16:27:45 +01:00
fix cpu error
Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/10432300 * fix cpu error
This commit is contained in:
committed by
yingda.chen
parent
535acaef5b
commit
e7c7be6aae
@@ -93,7 +93,7 @@ class TextDrivenSeg(TorchModel):
|
||||
"""
|
||||
with torch.no_grad():
|
||||
if self.device_id == -1:
|
||||
output = self.model(image)
|
||||
output = self.model(image, [text])
|
||||
else:
|
||||
device = torch.device('cuda', self.device_id)
|
||||
output = self.model(image.to(device), [text])
|
||||
|
||||
Reference in New Issue
Block a user