Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Swin-Transformer-Object-Detection
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wanggh
Swin-Transformer-Object-Detection
Commits
927d71a9
Unverified
Commit
927d71a9
authored
4 years ago
by
Kai Chen
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
use mmcv.utils.collect_env to avoid duplicate codes (#3779)
parent
7a404a2c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mmdet/utils/collect_env.py
+3
-52
3 additions, 52 deletions
mmdet/utils/collect_env.py
setup.cfg
+1
-1
1 addition, 1 deletion
setup.cfg
with
4 additions
and
53 deletions
mmdet/utils/collect_env.py
+
3
−
52
View file @
927d71a9
import
os.path
as
osp
from
mmcv.utils
import
collect_env
as
collect_base_env
import
subprocess
from
mmcv.utils
import
get_git_hash
import
sys
from
collections
import
defaultdict
import
cv2
import
mmcv
import
torch
import
torchvision
from
mmcv.utils
import
get_build_config
,
get_git_hash
import
mmdet
import
mmdet
def
collect_env
():
def
collect_env
():
"""
Collect the information of the running environments.
"""
"""
Collect the information of the running environments.
"""
env_info
=
{}
env_info
=
collect_base_env
()
env_info
[
'
sys.platform
'
]
=
sys
.
platform
env_info
[
'
Python
'
]
=
sys
.
version
.
replace
(
'
\n
'
,
''
)
cuda_available
=
torch
.
cuda
.
is_available
()
env_info
[
'
CUDA available
'
]
=
cuda_available
if
cuda_available
:
from
torch.utils.cpp_extension
import
CUDA_HOME
env_info
[
'
CUDA_HOME
'
]
=
CUDA_HOME
if
CUDA_HOME
is
not
None
and
osp
.
isdir
(
CUDA_HOME
):
try
:
nvcc
=
osp
.
join
(
CUDA_HOME
,
'
bin/nvcc
'
)
nvcc
=
subprocess
.
check_output
(
f
'"
{
nvcc
}
"
-V | tail -n1
'
,
shell
=
True
)
nvcc
=
nvcc
.
decode
(
'
utf-8
'
).
strip
()
except
subprocess
.
SubprocessError
:
nvcc
=
'
Not Available
'
env_info
[
'
NVCC
'
]
=
nvcc
devices
=
defaultdict
(
list
)
for
k
in
range
(
torch
.
cuda
.
device_count
()):
devices
[
torch
.
cuda
.
get_device_name
(
k
)].
append
(
str
(
k
))
for
name
,
devids
in
devices
.
items
():
env_info
[
'
GPU
'
+
'
,
'
.
join
(
devids
)]
=
name
gcc
=
subprocess
.
check_output
(
'
gcc --version | head -n1
'
,
shell
=
True
)
gcc
=
gcc
.
decode
(
'
utf-8
'
).
strip
()
env_info
[
'
GCC
'
]
=
gcc
env_info
[
'
PyTorch
'
]
=
torch
.
__version__
env_info
[
'
PyTorch compiling details
'
]
=
get_build_config
()
env_info
[
'
TorchVision
'
]
=
torchvision
.
__version__
env_info
[
'
OpenCV
'
]
=
cv2
.
__version__
env_info
[
'
MMCV
'
]
=
mmcv
.
__version__
env_info
[
'
MMDetection
'
]
=
mmdet
.
__version__
+
'
+
'
+
get_git_hash
()[:
7
]
env_info
[
'
MMDetection
'
]
=
mmdet
.
__version__
+
'
+
'
+
get_git_hash
()[:
7
]
from
mmcv.ops
import
get_compiler_version
,
get_compiling_cuda_version
env_info
[
'
MMDetection Compiler
'
]
=
get_compiler_version
()
env_info
[
'
MMDetection CUDA Compiler
'
]
=
get_compiling_cuda_version
()
return
env_info
return
env_info
...
...
This diff is collapsed.
Click to expand it.
setup.cfg
+
1
−
1
View file @
927d71a9
...
@@ -3,7 +3,7 @@ line_length = 79
...
@@ -3,7 +3,7 @@ line_length = 79
multi_line_output
=
0
multi_line_output
=
0
known_standard_library
=
setuptools
known_standard_library
=
setuptools
known_first_party
=
mmdet
known_first_party
=
mmdet
known_third_party
=
PIL,asynctest,cityscapesscripts,cv2,matplotlib,mmcv,numpy,onnx,onnxruntime,pycocotools,pytest,robustness_eval,seaborn,six,terminaltables,torch
,torchvision
known_third_party
=
PIL,asynctest,cityscapesscripts,cv2,matplotlib,mmcv,numpy,onnx,onnxruntime,pycocotools,pytest,robustness_eval,seaborn,six,terminaltables,torch
no_lines_before
=
STDLIB,LOCALFOLDER
no_lines_before
=
STDLIB,LOCALFOLDER
default_section
=
THIRDPARTY
default_section
=
THIRDPARTY
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment