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
yaoyuping
nnDetection
Commits
fcc1cd64
Commit
fcc1cd64
authored
Jun 02, 2022
by
Baumgartner, Michael
Browse files
import external in sweep
parent
930b5c25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
scripts/train.py
scripts/train.py
+5
-0
No files found.
scripts/train.py
View file @
fcc1cd64
...
@@ -18,6 +18,7 @@ import os
...
@@ -18,6 +18,7 @@ import os
import
sys
import
sys
import
socket
import
socket
import
argparse
import
argparse
import
importlib
from
pathlib
import
Path
from
pathlib
import
Path
from
datetime
import
datetime
from
datetime
import
datetime
from
typing
import
List
from
typing
import
List
...
@@ -347,6 +348,10 @@ def _sweep(
...
@@ -347,6 +348,10 @@ def _sweep(
cfg
=
OmegaConf
.
load
(
str
(
train_dir
/
"config.yaml"
))
cfg
=
OmegaConf
.
load
(
str
(
train_dir
/
"config.yaml"
))
os
.
chdir
(
str
(
train_dir
))
os
.
chdir
(
str
(
train_dir
))
for
imp
in
cfg
.
get
(
"additional_imports"
,
[]):
print
(
f
"Additional import found
{
imp
}
"
)
importlib
.
import_module
(
imp
)
logger
.
remove
()
logger
.
remove
()
logger
.
add
(
sys
.
stdout
,
format
=
"{level} {message}"
,
level
=
"INFO"
)
logger
.
add
(
sys
.
stdout
,
format
=
"{level} {message}"
,
level
=
"INFO"
)
log_file
=
Path
(
os
.
getcwd
())
/
"sweep.log"
log_file
=
Path
(
os
.
getcwd
())
/
"sweep.log"
...
...
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