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
6d921e36
Commit
6d921e36
authored
Feb 19, 2018
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
misc small changes
parent
b8349bcf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
16 deletions
+18
-16
examples/ResNet/imagenet-resnet.py
examples/ResNet/imagenet-resnet.py
+1
-1
examples/basics/mnist-convnet.py
examples/basics/mnist-convnet.py
+0
-1
tensorpack/callbacks/prof.py
tensorpack/callbacks/prof.py
+8
-5
tensorpack/dataflow/parallel.py
tensorpack/dataflow/parallel.py
+8
-8
tensorpack/input_source/input_source.py
tensorpack/input_source/input_source.py
+1
-1
No files found.
examples/ResNet/imagenet-resnet.py
View file @
6d921e36
...
...
@@ -116,7 +116,7 @@ if __name__ == '__main__':
parser
.
add_argument
(
'-d'
,
'--depth'
,
help
=
'resnet depth'
,
type
=
int
,
default
=
18
,
choices
=
[
18
,
34
,
50
,
101
,
152
])
parser
.
add_argument
(
'--eval'
,
action
=
'store_true'
)
parser
.
add_argument
(
'--batch'
,
help
=
'total batch size.
256 gives best accuracy.
'
,
parser
.
add_argument
(
'--batch'
,
help
=
'total batch size.
32 per GPU gives best accuracy, higher values should be similarly good
'
,
default
=
256
,
type
=
int
)
parser
.
add_argument
(
'--mode'
,
choices
=
[
'resnet'
,
'preact'
,
'se'
],
help
=
'variants of resnet to use'
,
default
=
'resnet'
)
...
...
examples/basics/mnist-convnet.py
View file @
6d921e36
...
...
@@ -40,7 +40,6 @@ class Model(ModelDesc):
image
=
tf
.
expand_dims
(
image
,
3
)
image
=
image
*
2
-
1
# center the pixels values at zero
# The context manager `argscope` sets the default option for all the layers under
# this context. Here we use 32 channel convolution with shape 3x3
with
argscope
(
Conv2D
,
kernel_shape
=
3
,
nl
=
tf
.
nn
.
relu
,
out_channel
=
32
):
...
...
tensorpack/callbacks/prof.py
View file @
6d921e36
...
...
@@ -173,18 +173,21 @@ class GraphProfiler(Callback):
class
PeakMemoryTracker
(
Callback
):
"""
Track peak memory in each session run, by
:mod:`tf.contrib.memory_stats`.
It can only be used for GPUs.
Track peak memory used on each GPU device, by :mod:`tf.contrib.memory_stats`.
The peak memory comes from the `MaxBytesInUse` op, which might span
multiple session.run.
See https://github.com/tensorflow/tensorflow/pull/13107.
"""
_chief_only
=
False
def
__init__
(
self
,
devices
=
[
'/gpu:0'
]):
def
__init__
(
self
,
devices
=
[
0
]):
"""
Args:
devices([
str]): list of
devices to track memory on.
devices([
int] or [str]): list of GPU
devices to track memory on.
"""
assert
isinstance
(
devices
,
(
list
,
tuple
)),
devices
devices
=
[
'/gpu:{}'
.
format
(
x
)
if
isinstance
(
x
,
int
)
else
x
for
x
in
devices
]
self
.
_devices
=
devices
def
_setup_graph
(
self
):
...
...
tensorpack/dataflow/parallel.py
View file @
6d921e36
...
...
@@ -111,15 +111,15 @@ class _MultiProcessZMQDataFlow(DataFlow):
start_proc_mask_signal
(
self
.
_procs
)
def
__del__
(
self
):
if
not
self
.
_reset_done
:
return
if
not
self
.
context
.
closed
:
self
.
socket
.
close
(
0
)
self
.
context
.
destroy
(
0
)
for
x
in
self
.
_procs
:
x
.
terminate
()
x
.
join
(
5
)
try
:
if
not
self
.
_reset_done
:
return
if
not
self
.
context
.
closed
:
self
.
socket
.
close
(
0
)
self
.
context
.
destroy
(
0
)
for
x
in
self
.
_procs
:
x
.
terminate
()
x
.
join
(
5
)
print
(
"{} successfully cleaned-up."
.
format
(
type
(
self
)
.
__name__
))
except
Exception
:
pass
...
...
tensorpack/input_source/input_source.py
View file @
6d921e36
...
...
@@ -496,7 +496,7 @@ class StagingInput(FeedfreeInput):
logger
.
info
(
"Pre-filling StagingArea ..."
)
for
k
in
range
(
self
.
nr_stage
):
self
.
stage_op
.
run
()
logger
.
info
(
"
Put {} element(s) to StagingArea."
)
logger
.
info
(
"
Successfully put {} element(s) to StagingArea."
.
format
(
self
.
nr_stage
)
)
def
_before_run
(
self
,
ctx
):
# This has to happen once, right before the first iteration.
...
...
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