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
MMCV
Commits
517e061c
Commit
517e061c
authored
Oct 15, 2018
by
Kai Chen
Browse files
bug fix for config path
parent
7205c2b1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
mmcv/utils/config.py
mmcv/utils/config.py
+3
-1
No files found.
mmcv/utils/config.py
View file @
517e061c
...
...
@@ -77,11 +77,13 @@ class Config(object):
filename
=
osp
.
abspath
(
osp
.
expanduser
(
filename
))
check_file_exist
(
filename
)
if
filename
.
endswith
(
'.py'
):
sys
.
path
.
append
(
osp
.
dirname
(
filename
))
module_name
=
osp
.
basename
(
filename
)[:
-
3
]
if
'.'
in
module_name
:
raise
ValueError
(
'Dots are not allowed in config file path.'
)
config_dir
=
osp
.
dirname
(
filename
)
sys
.
path
.
insert
(
0
,
config_dir
)
mod
=
import_module
(
module_name
)
sys
.
path
.
pop
(
0
)
cfg_dict
=
{
name
:
value
for
name
,
value
in
mod
.
__dict__
.
items
()
...
...
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