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
04c81965
You need to sign in or sign up before continuing.
Commit
04c81965
authored
Aug 24, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update docs
parent
0226451c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
tensorpack/input_source/input_source.py
tensorpack/input_source/input_source.py
+10
-3
tensorpack/models/batch_norm.py
tensorpack/models/batch_norm.py
+1
-1
No files found.
tensorpack/input_source/input_source.py
View file @
04c81965
...
...
@@ -449,13 +449,16 @@ class TFDatasetInput(FeedfreeInput):
Use a :class:`tf.data.Dataset` instance as input.
Note:
In training, the dataset should be infinite (use :func:`repeat()`).
1. In training, the given dataset or dataflow has to be infinite
(you can use :func:`repeat()`, or :class:`RepeatedData` ).
2. TensorFlow may keep the dataflow alive even if the dataset is no
longer used.
"""
def
__init__
(
self
,
dataset
):
"""
Args:
dataset (tf.data.Dataset or DataFlow): if a DataFlow, the dataflow
has to be infinite.
dataset (tf.data.Dataset or DataFlow):
"""
if
isinstance
(
dataset
,
tf
.
data
.
Dataset
):
self
.
_dataset
=
dataset
...
...
@@ -519,6 +522,10 @@ class TFDatasetInput(FeedfreeInput):
Returns:
(tf.data.Dataset)
Note:
TensorFlow may keep the dataflow alive even if the dataset is no
longer used.
"""
# TODO theoretically it can support dict
assert
isinstance
(
df
,
DataFlow
),
df
...
...
tensorpack/models/batch_norm.py
View file @
04c81965
...
...
@@ -322,7 +322,7 @@ def BatchNorm(inputs, axis=None, training=None, momentum=0.9, epsilon=1e-5,
logger
.
warn
(
"BatchNorm(sync_statistics='horovod') is used with only one process!"
)
else
:
import
horovod
hvd_version
=
tuple
(
map
(
int
,
horovod
.
__version__
.
split
(
'.'
)))
hvd_version
=
tuple
(
map
(
int
,
horovod
.
__version__
.
split
(
'.'
)
[:
3
]
))
assert
hvd_version
>=
(
0
,
13
,
6
),
"sync_statistics=horovod needs horovod>=0.13.6 !"
batch_mean
=
hvd
.
allreduce
(
batch_mean
,
average
=
True
)
...
...
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