Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lucas Miranda
deepOF
Commits
509f5187
Commit
509f5187
authored
Dec 04, 2020
by
lucas_miranda
Browse files
Adds output path option to train_model.py
parent
8e00f0ca
Pipeline
#88835
failed with stage
in 18 minutes and 38 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
deepof/train_utils.py
View file @
509f5187
...
...
@@ -72,6 +72,7 @@ def get_callbacks(
predictor
:
float
,
loss
:
str
,
logparam
:
dict
=
None
,
outpath
:
str
=
"."
,
)
->
List
[
Union
[
Any
]]:
"""Generates callbacks for model training, including:
- run_ID: run name, with coarse parameter details;
...
...
@@ -92,7 +93,7 @@ def get_callbacks(
datetime
.
now
().
strftime
(
"%Y%m%d-%H%M%S"
),
)
log_dir
=
os
.
path
.
abspath
(
"logs/fit/{}"
.
format
(
run_ID
))
log_dir
=
os
.
path
.
abspath
(
os
.
path
.
join
(
outpath
,
"fit"
,
run_ID
))
tensorboard_callback
=
tf
.
keras
.
callbacks
.
TensorBoard
(
log_dir
=
log_dir
,
histogram_freq
=
1
,
...
...
@@ -108,7 +109,7 @@ def get_callbacks(
if
cp
:
cp_callback
=
tf
.
keras
.
callbacks
.
ModelCheckpoint
(
"./logs/
checkpoints
/"
+
run_ID
+
"/cp-{epoch:04d}.ckpt"
,
os
.
path
.
join
(
outpath
,
"
checkpoints
"
,
run_ID
+
"/cp-{epoch:04d}.ckpt"
)
,
verbose
=
1
,
save_best_only
=
False
,
save_weights_only
=
True
,
...
...
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