Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
b8fe259f
Unverified
Commit
b8fe259f
authored
Jun 09, 2023
by
Yih-Dar
Committed by
GitHub
Jun 09, 2023
Browse files
Fix SAM OOM issue on CI (#24125)
fix Co-authored-by:
ydshieh
<
ydshieh@users.noreply.github.com
>
parent
707023d1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
tests/models/sam/test_modeling_sam.py
tests/models/sam/test_modeling_sam.py
+7
-0
tests/models/sam/test_modeling_tf_sam.py
tests/models/sam/test_modeling_tf_sam.py
+6
-0
No files found.
tests/models/sam/test_modeling_sam.py
View file @
b8fe259f
...
...
@@ -15,6 +15,7 @@
""" Testing suite for the PyTorch SAM model. """
import
gc
import
inspect
import
unittest
...
...
@@ -461,6 +462,12 @@ def prepare_dog_img():
@
slow
class
SamModelIntegrationTest
(
unittest
.
TestCase
):
def
tearDown
(
self
):
super
().
tearDown
()
# clean-up as much as possible GPU memory occupied by PyTorch
gc
.
collect
()
torch
.
cuda
.
empty_cache
()
def
test_inference_mask_generation_no_point
(
self
):
model
=
SamModel
.
from_pretrained
(
"facebook/sam-vit-base"
)
processor
=
SamProcessor
.
from_pretrained
(
"facebook/sam-vit-base"
)
...
...
tests/models/sam/test_modeling_tf_sam.py
View file @
b8fe259f
...
...
@@ -17,6 +17,7 @@
from
__future__
import
annotations
import
gc
import
inspect
import
unittest
...
...
@@ -429,6 +430,11 @@ def prepare_dog_img():
@
slow
class
SamModelIntegrationTest
(
unittest
.
TestCase
):
def
tearDown
(
self
):
super
().
tearDown
()
# clean-up as much as possible GPU memory occupied by PyTorch
gc
.
collect
()
def
test_inference_mask_generation_no_point
(
self
):
model
=
TFSamModel
.
from_pretrained
(
"facebook/sam-vit-base"
)
processor
=
SamProcessor
.
from_pretrained
(
"facebook/sam-vit-base"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment