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
7ae014f1
Commit
7ae014f1
authored
Jul 31, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check cv2 cuda support during import
parent
1bf2737f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
10 deletions
+23
-10
docs/conf.py
docs/conf.py
+2
-3
docs/tutorial/index.rst
docs/tutorial/index.rst
+1
-1
tensorpack/graph_builder/input_source.py
tensorpack/graph_builder/input_source.py
+1
-0
tensorpack/graph_builder/input_source_base.py
tensorpack/graph_builder/input_source_base.py
+1
-2
tensorpack/libinfo.py
tensorpack/libinfo.py
+14
-2
tensorpack/train/base.py
tensorpack/train/base.py
+4
-2
No files found.
docs/conf.py
View file @
7ae014f1
...
...
@@ -350,7 +350,7 @@ def process_signature(app, what, name, obj, options, signature,
return
signature
,
return_annotation
def
autodoc_skip_member
(
app
,
what
,
name
,
obj
,
skip
,
options
):
for
deprecat
e
in
[
if
nam
e
in
[
'DistributedReplicatedTrainer'
,
'SingleCostFeedfreeTrainer'
,
'SimpleFeedfreeTrainer'
,
...
...
@@ -360,8 +360,7 @@ def autodoc_skip_member(app, what, name, obj, skip, options):
'remap_get_variable'
,
'freeze_get_variable'
,
'ParamRestore'
]:
if
deprecate
in
name
:
return
True
return
True
if
name
in
[
'get_data'
,
'size'
,
'reset_state'
]:
# skip these methods with empty docstring
if
not
obj
.
__doc__
and
inspect
.
isfunction
(
obj
):
...
...
docs/tutorial/index.rst
View file @
7ae014f1
...
...
@@ -14,7 +14,7 @@ A High Level Glance
* You can use any TF-based symbolic function library to define a model in tensorpack.
And ``ModelDesc`` is an interface to connect symbolic graph to tensorpack trainers.
:doc:`
model
` introduces where and how you define the graph for tensorpack trainers to use,
:doc:`
graph` and :doc:`symbolic
` introduces where and how you define the graph for tensorpack trainers to use,
and how you can benefit from the small symbolic function library in tensorpack.
Both DataFlow and models can be used outside tensorpack, as just a data processing library and a symbolic
...
...
tensorpack/graph_builder/input_source.py
View file @
7ae014f1
...
...
@@ -72,6 +72,7 @@ class FeedInput(InputSource):
"""
assert
isinstance
(
ds
,
DataFlow
),
ds
self
.
ds
=
ds
# TODO avoid infinite repeat, to allow accurate size handling
self
.
_repeat_ds
=
RepeatedData
(
self
.
ds
,
-
1
)
def
_size
(
self
):
...
...
tensorpack/graph_builder/input_source_base.py
View file @
7ae014f1
...
...
@@ -49,9 +49,8 @@ class InputSource(object):
def
reset_state
(
self
):
"""
Semantics of this method has not been well defined
.
Reinitialize this InputSource
.
"""
# TODO
self
.
_reset_state
()
def
_reset_state
(
self
):
...
...
tensorpack/libinfo.py
View file @
7ae014f1
import
os
from
.utils
import
logger
# issue#7378 may happen with custom opencv. It doesn't hurt to disable opencl
os
.
environ
[
'OPENCV_OPENCL_RUNTIME'
]
=
''
try
:
# issue#1924 may happen on old systems
import
cv2
# noqa
if
int
(
cv2
.
__version__
.
split
(
'.'
)[
0
])
==
3
:
cv2
.
ocl
.
setUseOpenCL
(
False
)
except
ImportError
:
pass
else
:
if
int
(
cv2
.
__version__
.
split
(
'.'
)[
0
])
==
3
:
cv2
.
ocl
.
setUseOpenCL
(
False
)
# check if cv is built with cuda
info
=
cv2
.
getBuildInformation
()
.
split
(
'
\n
'
)
for
line
in
info
:
if
'use cuda'
in
line
.
lower
():
answer
=
line
.
split
()[
-
1
]
.
lower
()
if
answer
==
'yes'
:
# issue#1197
logger
.
warn
(
"OpenCV is built with CUDA support. "
"This may cause slow initialization or sometimes segfault with TensorFlow."
)
break
os
.
environ
[
'TF_ENABLE_WINOGRAD_NONFUSED'
]
=
'1'
# issue#9339
os
.
environ
[
'TF_AUTOTUNE_THRESHOLD'
]
=
'3'
# use more warm-up
...
...
tensorpack/train/base.py
View file @
7ae014f1
...
...
@@ -33,14 +33,13 @@ class Trainer(object):
Attributes:
config (TrainConfig): the config used in this trainer.
model (ModelDesc)
model (ModelDesc)
:
sess (tf.Session): the current session in use.
hooked_sess (tf.MonitoredSession): the session with hooks.
monitors (Monitors): the monitors. Callbacks can use it for logging.
epoch_num (int): the number of epochs that have finished.
local_step (int): the number of steps that have finished in the current epoch.
global_step (int): the number of steps that have finished or is currently running.
"""
# step attr only available after before_train?
...
...
@@ -174,6 +173,9 @@ class Trainer(object):
@
property
def
global_step
(
self
):
"""
The number of steps that have finished or is currently running.
"""
try
:
return
self
.
_starting_step
+
\
self
.
config
.
steps_per_epoch
*
(
self
.
epoch_num
-
1
)
+
\
...
...
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