Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
44076798
You need to sign in or sign up before continuing.
Commit
44076798
authored
Aug 03, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Normalize paths given by users (fix #1294)
parent
5969bf53
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
2 deletions
+4
-2
tensorpack/callbacks/monitor.py
tensorpack/callbacks/monitor.py
+1
-1
tensorpack/callbacks/saver.py
tensorpack/callbacks/saver.py
+2
-1
tensorpack/utils/logger.py
tensorpack/utils/logger.py
+1
-0
No files found.
tensorpack/callbacks/monitor.py
View file @
44076798
...
...
@@ -239,7 +239,7 @@ class TFEventWriter(MonitorBase):
if
logdir
is
None
:
logdir
=
logger
.
get_logger_dir
()
assert
tf
.
gfile
.
IsDirectory
(
logdir
),
logdir
self
.
_logdir
=
logdir
self
.
_logdir
=
os
.
path
.
normpath
(
logdir
)
self
.
_max_queue
=
max_queue
self
.
_flush_secs
=
flush_secs
self
.
_split_files
=
split_files
...
...
tensorpack/callbacks/saver.py
View file @
44076798
...
...
@@ -42,7 +42,7 @@ class ModelSaver(Callback):
if
checkpoint_dir
is
not
None
:
if
not
tf
.
gfile
.
IsDirectory
(
checkpoint_dir
):
# v2: tf.io.gfile.isdir
tf
.
gfile
.
MakeDirs
(
checkpoint_dir
)
# v2: tf.io.gfile.makedirs
self
.
checkpoint_dir
=
checkpoint_dir
self
.
checkpoint_dir
=
os
.
path
.
normpath
(
checkpoint_dir
)
def
_setup_graph
(
self
):
assert
self
.
checkpoint_dir
is
not
None
,
\
...
...
@@ -118,6 +118,7 @@ class MinSaver(Callback):
self
.
checkpoint_dir
=
checkpoint_dir
if
self
.
checkpoint_dir
is
None
:
self
.
checkpoint_dir
=
logger
.
get_logger_dir
()
self
.
checkpoint_dir
=
os
.
path
.
normpath
(
self
.
checkpoint_dir
)
def
_get_stat
(
self
):
try
:
...
...
tensorpack/utils/logger.py
View file @
44076798
...
...
@@ -109,6 +109,7 @@ def set_logger_dir(dirname, action=None):
old states for you. It simply does nothing.
"""
dirname
=
os
.
path
.
normpath
(
dirname
)
global
LOG_DIR
,
_FILE_HANDLER
if
_FILE_HANDLER
:
# unload and close the old file handler, so that we may safely delete the logger directory
...
...
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