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
OpenDAS
vision
Commits
539c6e29
Unverified
Commit
539c6e29
authored
Feb 09, 2023
by
Nicolas Hug
Committed by
GitHub
Feb 09, 2023
Browse files
Put back previous tolerance for test_classification and test_video (#7202)
parent
86f551d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
test/test_models.py
test/test_models.py
+2
-2
No files found.
test/test_models.py
View file @
539c6e29
...
@@ -686,7 +686,7 @@ def test_classification_model(model_fn, dev):
...
@@ -686,7 +686,7 @@ def test_classification_model(model_fn, dev):
model
.
eval
().
to
(
device
=
dev
)
model
.
eval
().
to
(
device
=
dev
)
x
=
_get_image
(
input_shape
=
input_shape
,
real_image
=
real_image
,
device
=
dev
)
x
=
_get_image
(
input_shape
=
input_shape
,
real_image
=
real_image
,
device
=
dev
)
out
=
model
(
x
)
out
=
model
(
x
)
_assert_expected
(
out
.
cpu
(),
model_name
,
prec
=
1e-3
)
_assert_expected
(
out
.
cpu
(),
model_name
,
prec
=
0.1
)
assert
out
.
shape
[
-
1
]
==
num_classes
assert
out
.
shape
[
-
1
]
==
num_classes
_check_jit_scriptable
(
model
,
(
x
,),
unwrapper
=
script_model_unwrapper
.
get
(
model_name
,
None
),
eager_out
=
out
)
_check_jit_scriptable
(
model
,
(
x
,),
unwrapper
=
script_model_unwrapper
.
get
(
model_name
,
None
),
eager_out
=
out
)
_check_fx_compatible
(
model
,
x
,
eager_out
=
out
)
_check_fx_compatible
(
model
,
x
,
eager_out
=
out
)
...
@@ -917,7 +917,7 @@ def test_video_model(model_fn, dev):
...
@@ -917,7 +917,7 @@ def test_video_model(model_fn, dev):
# RNG always on CPU, to ensure x in cuda tests is bitwise identical to x in cpu tests
# RNG always on CPU, to ensure x in cuda tests is bitwise identical to x in cpu tests
x
=
torch
.
rand
(
input_shape
).
to
(
device
=
dev
)
x
=
torch
.
rand
(
input_shape
).
to
(
device
=
dev
)
out
=
model
(
x
)
out
=
model
(
x
)
_assert_expected
(
out
.
cpu
(),
model_name
,
prec
=
1e-5
)
_assert_expected
(
out
.
cpu
(),
model_name
,
prec
=
0.1
)
assert
out
.
shape
[
-
1
]
==
num_classes
assert
out
.
shape
[
-
1
]
==
num_classes
_check_jit_scriptable
(
model
,
(
x
,),
unwrapper
=
script_model_unwrapper
.
get
(
model_name
,
None
),
eager_out
=
out
)
_check_jit_scriptable
(
model
,
(
x
,),
unwrapper
=
script_model_unwrapper
.
get
(
model_name
,
None
),
eager_out
=
out
)
_check_fx_compatible
(
model
,
x
,
eager_out
=
out
)
_check_fx_compatible
(
model
,
x
,
eager_out
=
out
)
...
...
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