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
5c9174db
Commit
5c9174db
authored
Sep 14, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix build
parent
5fc3a2b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
tensorpack/callbacks/prof.py
tensorpack/callbacks/prof.py
+7
-2
tensorpack/models/pool.py
tensorpack/models/pool.py
+4
-0
No files found.
tensorpack/callbacks/prof.py
View file @
5c9174db
...
@@ -14,6 +14,7 @@ from tensorflow.python.client import timeline
...
@@ -14,6 +14,7 @@ from tensorflow.python.client import timeline
from
.base
import
Callback
from
.base
import
Callback
from
..utils
import
logger
from
..utils
import
logger
from
..utils.concurrency
import
ensure_proc_terminate
,
subproc_call
from
..utils.concurrency
import
ensure_proc_terminate
,
subproc_call
from
..utils.gpu
import
get_nr_gpu
__all__
=
[
'GPUUtilizationTracker'
,
'GraphProfiler'
]
__all__
=
[
'GPUUtilizationTracker'
,
'GraphProfiler'
]
...
@@ -33,8 +34,12 @@ class GPUUtilizationTracker(Callback):
...
@@ -33,8 +34,12 @@ class GPUUtilizationTracker(Callback):
"""
"""
if
devices
is
None
:
if
devices
is
None
:
env
=
os
.
environ
.
get
(
'CUDA_VISIBLE_DEVICES'
)
env
=
os
.
environ
.
get
(
'CUDA_VISIBLE_DEVICES'
)
assert
env
is
not
None
,
"[GPUUtilizationTracker] Both devices and CUDA_VISIBLE_DEVICES are None!"
if
env
is
None
:
self
.
_devices
=
env
.
split
(
','
)
logger
.
warn
(
"[GPUUtilizationTracker] Both devices and CUDA_VISIBLE_DEVICES are None! "
"Will monitor all visible GPUs!"
)
self
.
_devices
=
list
(
range
(
get_nr_gpu
()))
else
:
self
.
_devices
=
env
.
split
(
','
)
else
:
else
:
self
.
_devices
=
list
(
map
(
str
,
devices
))
self
.
_devices
=
list
(
map
(
str
,
devices
))
assert
len
(
self
.
_devices
),
"[GPUUtilizationTracker] No GPU device given!"
assert
len
(
self
.
_devices
),
"[GPUUtilizationTracker] No GPU device given!"
...
...
tensorpack/models/pool.py
View file @
5c9174db
...
@@ -29,6 +29,8 @@ def MaxPooling(x, shape, stride=None, padding='VALID', data_format='NHWC'):
...
@@ -29,6 +29,8 @@ def MaxPooling(x, shape, stride=None, padding='VALID', data_format='NHWC'):
Returns:
Returns:
tf.Tensor named ``output``.
tf.Tensor named ``output``.
"""
"""
if
stride
is
None
:
stride
=
shape
ret
=
tf
.
layers
.
max_pooling2d
(
x
,
shape
,
stride
,
padding
,
ret
=
tf
.
layers
.
max_pooling2d
(
x
,
shape
,
stride
,
padding
,
'channels_last'
if
data_format
==
'NHWC'
else
'channels_first'
)
'channels_last'
if
data_format
==
'NHWC'
else
'channels_first'
)
return
tf
.
identity
(
ret
,
name
=
'output'
)
return
tf
.
identity
(
ret
,
name
=
'output'
)
...
@@ -48,6 +50,8 @@ def AvgPooling(x, shape, stride=None, padding='VALID', data_format='NHWC'):
...
@@ -48,6 +50,8 @@ def AvgPooling(x, shape, stride=None, padding='VALID', data_format='NHWC'):
Returns:
Returns:
tf.Tensor named ``output``.
tf.Tensor named ``output``.
"""
"""
if
stride
is
None
:
stride
=
shape
ret
=
tf
.
layers
.
average_pooling2d
(
x
,
shape
,
stride
,
padding
,
ret
=
tf
.
layers
.
average_pooling2d
(
x
,
shape
,
stride
,
padding
,
'channels_last'
if
data_format
==
'NHWC'
else
'channels_first'
)
'channels_last'
if
data_format
==
'NHWC'
else
'channels_first'
)
return
tf
.
identity
(
ret
,
name
=
'output'
)
return
tf
.
identity
(
ret
,
name
=
'output'
)
...
...
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