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
446eac61
Unverified
Commit
446eac61
authored
Jun 29, 2020
by
Francisco Massa
Committed by
GitHub
Jun 29, 2020
Browse files
Fix torchhub due to numerical changes in torch.sum (#2361)
parent
bb14c2bd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
test/test_hub.py
test/test_hub.py
+7
-5
No files found.
test/test_hub.py
View file @
446eac61
...
...
@@ -13,7 +13,7 @@ def sum_of_model_parameters(model):
return
s
SUM_OF_PRETRAINED_RESNET18_PARAMS
=
-
12703.99
60937
5
SUM_OF_PRETRAINED_RESNET18_PARAMS
=
-
12703.99
3164062
5
@
unittest
.
skipIf
(
'torchvision'
in
sys
.
modules
,
...
...
@@ -31,8 +31,9 @@ class TestHub(unittest.TestCase):
'resnet18'
,
pretrained
=
True
,
progress
=
False
)
self
.
assertEqual
(
sum_of_model_parameters
(
hub_model
).
item
(),
SUM_OF_PRETRAINED_RESNET18_PARAMS
)
self
.
assertAlmostEqual
(
sum_of_model_parameters
(
hub_model
).
item
(),
SUM_OF_PRETRAINED_RESNET18_PARAMS
,
places
=
2
)
def
test_set_dir
(
self
):
temp_dir
=
tempfile
.
gettempdir
()
...
...
@@ -42,8 +43,9 @@ class TestHub(unittest.TestCase):
'resnet18'
,
pretrained
=
True
,
progress
=
False
)
self
.
assertEqual
(
sum_of_model_parameters
(
hub_model
).
item
(),
SUM_OF_PRETRAINED_RESNET18_PARAMS
)
self
.
assertAlmostEqual
(
sum_of_model_parameters
(
hub_model
).
item
(),
SUM_OF_PRETRAINED_RESNET18_PARAMS
,
places
=
2
)
self
.
assertTrue
(
os
.
path
.
exists
(
temp_dir
+
'/pytorch_vision_master'
))
shutil
.
rmtree
(
temp_dir
+
'/pytorch_vision_master'
)
...
...
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