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
fe1e88d3
Commit
fe1e88d3
authored
Jun 10, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JIT hurt performance
parent
9ca10d35
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
6 deletions
+10
-6
tensorpack/callbacks/graph.py
tensorpack/callbacks/graph.py
+3
-1
tensorpack/tfutils/common.py
tensorpack/tfutils/common.py
+2
-1
tensorpack/train/input_source.py
tensorpack/train/input_source.py
+4
-3
tensorpack/utils/viz.py
tensorpack/utils/viz.py
+1
-1
No files found.
tensorpack/callbacks/graph.py
View file @
fe1e88d3
...
@@ -40,6 +40,8 @@ class RunOp(Callback):
...
@@ -40,6 +40,8 @@ class RunOp(Callback):
def
_setup_graph
(
self
):
def
_setup_graph
(
self
):
self
.
_op
=
self
.
setup_func
()
self
.
_op
=
self
.
setup_func
()
if
self
.
run_step
:
self
.
_fetch
=
tf
.
train
.
SessionRunArgs
(
fetches
=
self
.
_op
)
def
_before_train
(
self
):
def
_before_train
(
self
):
if
self
.
run_before
:
if
self
.
run_before
:
...
@@ -54,7 +56,7 @@ class RunOp(Callback):
...
@@ -54,7 +56,7 @@ class RunOp(Callback):
def
_before_run
(
self
,
_
):
def
_before_run
(
self
,
_
):
if
self
.
run_step
:
if
self
.
run_step
:
self
.
_print
()
self
.
_print
()
return
[
self
.
_op
]
return
self
.
_fetch
# faster than return
[self._op]
def
_print
(
self
):
def
_print
(
self
):
if
self
.
verbose
:
if
self
.
verbose
:
...
...
tensorpack/tfutils/common.py
View file @
fe1e88d3
...
@@ -44,7 +44,8 @@ def get_default_sess_config(mem_fraction=0.99):
...
@@ -44,7 +44,8 @@ def get_default_sess_config(mem_fraction=0.99):
conf
.
gpu_options
.
allocator_type
=
'BFC'
conf
.
gpu_options
.
allocator_type
=
'BFC'
conf
.
gpu_options
.
allow_growth
=
True
conf
.
gpu_options
.
allow_growth
=
True
conf
.
graph_options
.
optimizer_options
.
global_jit_level
=
tf
.
OptimizerOptions
.
ON_1
# Hurt performance in 8xP100 training
# conf.graph_options.optimizer_options.global_jit_level = tf.OptimizerOptions.ON_1
return
conf
return
conf
...
...
tensorpack/train/input_source.py
View file @
fe1e88d3
...
@@ -379,9 +379,10 @@ class DummyConstantInput(TensorInput):
...
@@ -379,9 +379,10 @@ class DummyConstantInput(TensorInput):
assert
ctx
is
not
None
assert
ctx
is
not
None
assert
len
(
self
.
shapes
)
==
len
(
self
.
input_placehdrs
)
assert
len
(
self
.
shapes
)
==
len
(
self
.
input_placehdrs
)
for
idx
,
p
in
enumerate
(
self
.
input_placehdrs
):
for
idx
,
p
in
enumerate
(
self
.
input_placehdrs
):
tlist
.
append
(
tf
.
get_variable
(
tlist
.
append
(
tf
.
constant
(
'dummy-{}-{}'
.
format
(
p
.
op
.
name
,
ctx
.
index
),
shape
=
self
.
shapes
[
idx
],
0
,
dtype
=
p
.
dtype
,
dtype
=
p
.
dtype
,
trainable
=
False
))
name
=
'dummy-{}-{}'
.
format
(
p
.
op
.
name
,
ctx
.
index
),
shape
=
self
.
shapes
[
idx
]))
return
tlist
return
tlist
super
(
DummyConstantInput
,
self
)
.
__init__
(
fn
)
super
(
DummyConstantInput
,
self
)
.
__init__
(
fn
)
...
...
tensorpack/utils/viz.py
View file @
fe1e88d3
...
@@ -353,7 +353,7 @@ def intensity_to_rgb(intensity, cmap='cubehelix', normalize=False):
...
@@ -353,7 +353,7 @@ def intensity_to_rgb(intensity, cmap='cubehelix', normalize=False):
from
..utils.develop
import
create_dummy_func
# noqa
from
..utils.develop
import
create_dummy_func
# noqa
try
:
try
:
import
matplotlib.pyplot
as
plt
import
matplotlib.pyplot
as
plt
except
ImportError
:
except
(
ImportError
,
RuntimeError
)
:
pyplot2img
=
create_dummy_func
(
'pyplot2img'
,
'matplotlib'
)
# noqa
pyplot2img
=
create_dummy_func
(
'pyplot2img'
,
'matplotlib'
)
# noqa
intensity_to_rgb
=
create_dummy_func
(
'intensity_to_rgb'
,
'matplotlib'
)
# noqa
intensity_to_rgb
=
create_dummy_func
(
'intensity_to_rgb'
,
'matplotlib'
)
# noqa
...
...
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