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
ed4e5106
You need to sign in or sign up before continuing.
Commit
ed4e5106
authored
Jan 04, 2016
by
ppwwyyxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some bugs
parent
c713cb75
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
6 deletions
+8
-6
tensorpack/dataflow/image.py
tensorpack/dataflow/image.py
+1
-1
tensorpack/models/pool.py
tensorpack/models/pool.py
+1
-1
tensorpack/train.py
tensorpack/train.py
+3
-1
tensorpack/utils/logger.py
tensorpack/utils/logger.py
+2
-1
tensorpack/utils/symbolic_functions.py
tensorpack/utils/symbolic_functions.py
+1
-2
No files found.
tensorpack/dataflow/image.py
View file @
ed4e5106
...
@@ -16,7 +16,7 @@ class ImageFromFile(DataFlow):
...
@@ -16,7 +16,7 @@ class ImageFromFile(DataFlow):
channel: 1 or 3 channel
channel: 1 or 3 channel
resize: a (h, w) tuple. If given, will force a resize
resize: a (h, w) tuple. If given, will force a resize
"""
"""
assert
len
(
self
.
files
)
assert
len
(
files
)
self
.
files
=
files
self
.
files
=
files
self
.
channel
=
int
(
channel
)
self
.
channel
=
int
(
channel
)
self
.
resize
=
resize
self
.
resize
=
resize
...
...
tensorpack/models/pool.py
View file @
ed4e5106
...
@@ -39,7 +39,7 @@ def FixedUnPooling(x, shape, unpool_mat=None):
...
@@ -39,7 +39,7 @@ def FixedUnPooling(x, shape, unpool_mat=None):
input_shape
=
x
.
get_shape
()
.
as_list
()
input_shape
=
x
.
get_shape
()
.
as_list
()
assert
len
(
input_shape
)
==
4
assert
len
(
input_shape
)
==
4
if
unpool_mat
is
None
:
if
unpool_mat
is
None
:
mat
=
np
.
zeros
(
shape
)
mat
=
np
.
zeros
(
shape
,
dtype
=
'float32'
)
mat
[
0
][
0
]
=
1
mat
[
0
][
0
]
=
1
unpool_mat
=
tf
.
Variable
(
mat
,
trainable
=
False
,
name
=
'unpool_mat'
)
unpool_mat
=
tf
.
Variable
(
mat
,
trainable
=
False
,
name
=
'unpool_mat'
)
assert
unpool_mat
.
get_shape
()
.
as_list
()
==
list
(
shape
)
assert
unpool_mat
.
get_shape
()
.
as_list
()
==
list
(
shape
)
...
...
tensorpack/train.py
View file @
ed4e5106
...
@@ -103,6 +103,8 @@ def start_train(config):
...
@@ -103,6 +103,8 @@ def start_train(config):
def
get_model_inputs
():
def
get_model_inputs
():
model_inputs
=
input_queue
.
dequeue
()
model_inputs
=
input_queue
.
dequeue
()
if
isinstance
(
model_inputs
,
tf
.
Tensor
):
model_inputs
=
[
model_inputs
]
for
qv
,
v
in
zip
(
model_inputs
,
input_vars
):
for
qv
,
v
in
zip
(
model_inputs
,
input_vars
):
if
config
.
batched_model_input
:
if
config
.
batched_model_input
:
qv
.
set_shape
(
v
.
get_shape
())
qv
.
set_shape
(
v
.
get_shape
())
...
@@ -179,7 +181,7 @@ def start_train(config):
...
@@ -179,7 +181,7 @@ def start_train(config):
raise
raise
finally
:
finally
:
coord
.
request_stop
()
coord
.
request_stop
()
queue
.
close
(
cancel_pending_enqueues
=
True
)
input_
queue
.
close
(
cancel_pending_enqueues
=
True
)
callbacks
.
after_train
()
callbacks
.
after_train
()
sess
.
close
()
sess
.
close
()
tensorpack/utils/logger.py
View file @
ed4e5106
...
@@ -55,8 +55,9 @@ def set_file(path):
...
@@ -55,8 +55,9 @@ def set_file(path):
global
LOG_FILE
global
LOG_FILE
LOG_FILE
=
"train_log/log.log"
LOG_FILE
=
"train_log/log.log"
def
set_logger_file
(
filename
):
def
set_logger_file
(
filename
):
global
LOG_FILE
global
LOG_FILE
,
LOG_DIR
LOG_FILE
=
filename
LOG_FILE
=
filename
LOG_DIR
=
os
.
path
.
dirname
(
LOG_FILE
)
mkdir_p
(
os
.
path
.
dirname
(
LOG_FILE
))
mkdir_p
(
os
.
path
.
dirname
(
LOG_FILE
))
set_file
(
LOG_FILE
)
set_file
(
LOG_FILE
)
tensorpack/utils/symbolic_functions.py
View file @
ed4e5106
...
@@ -18,8 +18,7 @@ def one_hot(y, num_labels):
...
@@ -18,8 +18,7 @@ def one_hot(y, num_labels):
return
tf
.
cast
(
onehot_labels
,
tf
.
float32
)
return
tf
.
cast
(
onehot_labels
,
tf
.
float32
)
def
flatten
(
x
):
def
flatten
(
x
):
total_dim
=
np
.
prod
(
x
.
get_shape
()
.
as_list
())
return
tf
.
reshape
(
x
,
[
-
1
])
return
tf
.
reshape
(
x
,
[
total_dim
])
def
batch_flatten
(
x
):
def
batch_flatten
(
x
):
total_dim
=
np
.
prod
(
x
.
get_shape
()[
1
:]
.
as_list
())
total_dim
=
np
.
prod
(
x
.
get_shape
()[
1
:]
.
as_list
())
...
...
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