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
44e8a350
Unverified
Commit
44e8a350
authored
Mar 08, 2023
by
Philip Meier
Committed by
GitHub
Mar 08, 2023
Browse files
remove torch.hub tests (#7399)
parent
5850f370
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
66 deletions
+0
-66
.circleci/config.yml
.circleci/config.yml
+0
-10
.circleci/config.yml.in
.circleci/config.yml.in
+0
-10
test/test_hub.py
test/test_hub.py
+0
-46
No files found.
.circleci/config.yml
View file @
44e8a350
...
@@ -324,15 +324,6 @@ jobs:
...
@@ -324,15 +324,6 @@ jobs:
name
:
Check Python types statically
name
:
Check Python types statically
command
:
mypy --install-types --non-interactive --config-file mypy.ini
command
:
mypy --install-types --non-interactive --config-file mypy.ini
unittest_torchhub
:
docker
:
-
image
:
cimg/python:3.8
steps
:
-
checkout
-
install_torchvision
-
run_tests_selective
:
file_or_dir
:
test/test_hub.py
unittest_onnx
:
unittest_onnx
:
docker
:
docker
:
-
image
:
cimg/python:3.8
-
image
:
cimg/python:3.8
...
@@ -1257,7 +1248,6 @@ workflows:
...
@@ -1257,7 +1248,6 @@ workflows:
unittest
:
unittest
:
jobs
:
jobs
:
-
unittest_torchhub
-
unittest_onnx
-
unittest_onnx
-
unittest_extended
-
unittest_extended
-
unittest_windows_cpu
:
-
unittest_windows_cpu
:
...
...
.circleci/config.yml.in
View file @
44e8a350
...
@@ -324,15 +324,6 @@ jobs:
...
@@ -324,15 +324,6 @@ jobs:
name: Check Python types statically
name: Check Python types statically
command: mypy --install-types --non-interactive --config-file mypy.ini
command: mypy --install-types --non-interactive --config-file mypy.ini
unittest_torchhub:
docker:
- image: cimg/python:3.8
steps:
- checkout
- install_torchvision
- run_tests_selective:
file_or_dir: test/test_hub.py
unittest_onnx:
unittest_onnx:
docker:
docker:
- image: cimg/python:3.8
- image: cimg/python:3.8
...
@@ -1017,7 +1008,6 @@ workflows:
...
@@ -1017,7 +1008,6 @@ workflows:
unittest:
unittest:
jobs:
jobs:
- unittest_torchhub
- unittest_onnx
- unittest_onnx
- unittest_extended
- unittest_extended
{{ unittest_workflows() }}
{{ unittest_workflows() }}
...
...
test/test_hub.py
deleted
100644 → 0
View file @
5850f370
import
os
import
shutil
import
sys
import
tempfile
import
pytest
import
torch.hub
as
hub
def
sum_of_model_parameters
(
model
):
s
=
0
for
p
in
model
.
parameters
():
s
+=
p
.
sum
()
return
s
SUM_OF_PRETRAINED_RESNET18_PARAMS
=
-
12703.9931640625
@
pytest
.
mark
.
skipif
(
"torchvision"
in
sys
.
modules
,
reason
=
"TestHub must start without torchvision imported"
)
class
TestHub
:
# Only run this check ONCE before all tests start.
# - If torchvision is imported before all tests start, e.g. we might find _C.so
# which doesn't exist in downloaded zip but in the installed wheel.
# - After the first test is run, torchvision is already in sys.modules due to
# Python cache as we run all hub tests in the same python process.
def
test_load_from_github
(
self
):
hub_model
=
hub
.
load
(
"pytorch/vision"
,
"resnet18"
,
weights
=
"DEFAULT"
,
progress
=
False
)
assert
sum_of_model_parameters
(
hub_model
).
item
()
==
pytest
.
approx
(
SUM_OF_PRETRAINED_RESNET18_PARAMS
)
def
test_set_dir
(
self
):
temp_dir
=
tempfile
.
gettempdir
()
hub
.
set_dir
(
temp_dir
)
hub_model
=
hub
.
load
(
"pytorch/vision"
,
"resnet18"
,
weights
=
"DEFAULT"
,
progress
=
False
)
assert
sum_of_model_parameters
(
hub_model
).
item
()
==
pytest
.
approx
(
SUM_OF_PRETRAINED_RESNET18_PARAMS
)
assert
os
.
path
.
exists
(
temp_dir
+
"/pytorch_vision_master"
)
shutil
.
rmtree
(
temp_dir
+
"/pytorch_vision_master"
)
def
test_list_entrypoints
(
self
):
entry_lists
=
hub
.
list
(
"pytorch/vision"
,
force_reload
=
True
)
assert
"resnet18"
in
entry_lists
if
__name__
==
"__main__"
:
pytest
.
main
([
__file__
])
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