mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Fix device issue in UperNetModelIntegrationTest
(#21192)
fix device Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
parent
35920c9715
commit
5761ceb35a
@ -272,7 +272,7 @@ def prepare_img():
|
||||
class UperNetModelIntegrationTest(unittest.TestCase):
|
||||
def test_inference_swin_backbone(self):
|
||||
processor = AutoImageProcessor.from_pretrained("openmmlab/upernet-swin-tiny")
|
||||
model = UperNetForSemanticSegmentation.from_pretrained("openmmlab/upernet-swin-tiny")
|
||||
model = UperNetForSemanticSegmentation.from_pretrained("openmmlab/upernet-swin-tiny").to(torch_device)
|
||||
|
||||
image = prepare_img()
|
||||
inputs = processor(images=image, return_tensors="pt").to(torch_device)
|
||||
@ -290,7 +290,7 @@ class UperNetModelIntegrationTest(unittest.TestCase):
|
||||
|
||||
def test_inference_convnext_backbone(self):
|
||||
processor = AutoImageProcessor.from_pretrained("openmmlab/upernet-convnext-tiny")
|
||||
model = UperNetForSemanticSegmentation.from_pretrained("openmmlab/upernet-convnext-tiny")
|
||||
model = UperNetForSemanticSegmentation.from_pretrained("openmmlab/upernet-convnext-tiny").to(torch_device)
|
||||
|
||||
image = prepare_img()
|
||||
inputs = processor(images=image, return_tensors="pt").to(torch_device)
|
||||
|
Loading…
Reference in New Issue
Block a user