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
425d3a30
Commit
425d3a30
authored
Sep 27, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix in logger
parent
ad5a720a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
tensorpack/models/pool.py
tensorpack/models/pool.py
+2
-1
tensorpack/utils/logger.py
tensorpack/utils/logger.py
+4
-4
No files found.
tensorpack/models/pool.py
View file @
425d3a30
...
@@ -145,7 +145,8 @@ def BilinearUpSample(x, shape):
...
@@ -145,7 +145,8 @@ def BilinearUpSample(x, shape):
w
=
bilinear_conv_filler
(
filter_shape
)
w
=
bilinear_conv_filler
(
filter_shape
)
w
=
np
.
repeat
(
w
,
ch
*
ch
)
.
reshape
((
filter_shape
,
filter_shape
,
ch
,
ch
))
w
=
np
.
repeat
(
w
,
ch
*
ch
)
.
reshape
((
filter_shape
,
filter_shape
,
ch
,
ch
))
weight_var
=
tf
.
constant
(
w
,
tf
.
float32
,
weight_var
=
tf
.
constant
(
w
,
tf
.
float32
,
shape
=
(
filter_shape
,
filter_shape
,
ch
,
ch
))
shape
=
(
filter_shape
,
filter_shape
,
ch
,
ch
),
name
=
'bilinear_upsample_filter'
)
deconv
=
tf
.
nn
.
conv2d_transpose
(
x
,
weight_var
,
deconv
=
tf
.
nn
.
conv2d_transpose
(
x
,
weight_var
,
tf
.
shape
(
x
)
*
tf
.
constant
([
1
,
shape
,
shape
,
1
],
tf
.
int32
),
tf
.
shape
(
x
)
*
tf
.
constant
([
1
,
shape
,
shape
,
1
],
tf
.
int32
),
[
1
,
shape
,
shape
,
1
],
'SAME'
)
[
1
,
shape
,
shape
,
1
],
'SAME'
)
...
...
tensorpack/utils/logger.py
View file @
425d3a30
...
@@ -41,7 +41,7 @@ def _getlogger():
...
@@ -41,7 +41,7 @@ def _getlogger():
_logger
=
_getlogger
()
_logger
=
_getlogger
()
def
_
get_time_str
():
def
get_time_str
():
return
datetime
.
now
()
.
strftime
(
'
%
m
%
d-
%
H
%
M
%
S'
)
return
datetime
.
now
()
.
strftime
(
'
%
m
%
d-
%
H
%
M
%
S'
)
# logger file and directory:
# logger file and directory:
...
@@ -49,7 +49,7 @@ global LOG_FILE, LOG_DIR
...
@@ -49,7 +49,7 @@ global LOG_FILE, LOG_DIR
LOG_DIR
=
None
LOG_DIR
=
None
def
_set_file
(
path
):
def
_set_file
(
path
):
if
os
.
path
.
isfile
(
path
):
if
os
.
path
.
isfile
(
path
):
backup_name
=
path
+
'.'
+
_
get_time_str
()
backup_name
=
path
+
'.'
+
get_time_str
()
shutil
.
move
(
path
,
backup_name
)
shutil
.
move
(
path
,
backup_name
)
info
(
"Log file '{}' backuped to '{}'"
.
format
(
path
,
backup_name
))
info
(
"Log file '{}' backuped to '{}'"
.
format
(
path
,
backup_name
))
hdl
=
logging
.
FileHandler
(
hdl
=
logging
.
FileHandler
(
...
@@ -76,13 +76,13 @@ If you're resuming from a previous run you can choose to keep it.""")
...
@@ -76,13 +76,13 @@ If you're resuming from a previous run you can choose to keep it.""")
action
=
input
()
.
lower
()
.
strip
()
action
=
input
()
.
lower
()
.
strip
()
act
=
action
act
=
action
if
act
==
'b'
:
if
act
==
'b'
:
backup_name
=
dirname
+
_
get_time_str
()
backup_name
=
dirname
+
get_time_str
()
shutil
.
move
(
dirname
,
backup_name
)
shutil
.
move
(
dirname
,
backup_name
)
info
(
"Directory '{}' backuped to '{}'"
.
format
(
dirname
,
backup_name
))
info
(
"Directory '{}' backuped to '{}'"
.
format
(
dirname
,
backup_name
))
elif
act
==
'd'
:
elif
act
==
'd'
:
shutil
.
rmtree
(
dirname
)
shutil
.
rmtree
(
dirname
)
elif
act
==
'n'
:
elif
act
==
'n'
:
dirname
=
dirname
+
_
get_time_str
()
dirname
=
dirname
+
get_time_str
()
info
(
"Use a new log directory {}"
.
format
(
dirname
))
info
(
"Use a new log directory {}"
.
format
(
dirname
))
elif
act
==
'k'
:
elif
act
==
'k'
:
pass
pass
...
...
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