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
c0bf0772
Commit
c0bf0772
authored
May 13, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix json dump in py3, and logger format
parent
5c0d2c9b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
tensorpack/callbacks/summary.py
tensorpack/callbacks/summary.py
+1
-1
tensorpack/utils/logger.py
tensorpack/utils/logger.py
+1
-0
No files found.
tensorpack/callbacks/summary.py
View file @
c0bf0772
...
@@ -69,7 +69,7 @@ class StatHolder(object):
...
@@ -69,7 +69,7 @@ class StatHolder(object):
def
_write_stat
(
self
):
def
_write_stat
(
self
):
tmp_filename
=
self
.
filename
+
'.tmp'
tmp_filename
=
self
.
filename
+
'.tmp'
with
open
(
tmp_filename
,
'w
b
'
)
as
f
:
with
open
(
tmp_filename
,
'w'
)
as
f
:
json
.
dump
(
self
.
stat_history
,
f
)
json
.
dump
(
self
.
stat_history
,
f
)
os
.
rename
(
tmp_filename
,
self
.
filename
)
os
.
rename
(
tmp_filename
,
self
.
filename
)
...
...
tensorpack/utils/logger.py
View file @
c0bf0772
...
@@ -55,6 +55,7 @@ def _set_file(path):
...
@@ -55,6 +55,7 @@ def _set_file(path):
info
(
"Log file '{}' backuped to '{}'"
.
format
(
path
,
backup_name
))
info
(
"Log file '{}' backuped to '{}'"
.
format
(
path
,
backup_name
))
hdl
=
logging
.
FileHandler
(
hdl
=
logging
.
FileHandler
(
filename
=
path
,
encoding
=
'utf-8'
,
mode
=
'w'
)
filename
=
path
,
encoding
=
'utf-8'
,
mode
=
'w'
)
hdl
.
setFormatter
(
MyFormatter
(
datefmt
=
'
%
d
%
H:
%
M:
%
S'
))
logger
.
addHandler
(
hdl
)
logger
.
addHandler
(
hdl
)
def
set_logger_dir
(
dirname
,
action
=
None
):
def
set_logger_dir
(
dirname
,
action
=
None
):
...
...
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