Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
f1efaf83
Commit
f1efaf83
authored
Jan 08, 2019
by
Taylor Robie
Browse files
don't use forkpool to shuffle with TPUs
parent
c8be4828
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
official/recommendation/data_pipeline.py
official/recommendation/data_pipeline.py
+5
-1
No files found.
official/recommendation/data_pipeline.py
View file @
f1efaf83
...
...
@@ -378,6 +378,7 @@ class BaseDataConstructor(threading.Thread):
self
.
_current_epoch_order
=
np
.
empty
(
shape
=
(
0
,))
self
.
_shuffle_iterator
=
None
self
.
_shuffle_with_forkpool
=
stream_files
if
stream_files
:
self
.
_shard_root
=
tempfile
.
mkdtemp
(
prefix
=
"ncf_"
)
atexit
.
register
(
tf
.
gfile
.
DeleteRecursively
,
dirname
=
self
.
_shard_root
)
...
...
@@ -449,7 +450,10 @@ class BaseDataConstructor(threading.Thread):
raise
def
_start_shuffle_iterator
(
self
):
if
self
.
_shuffle_with_forkpool
:
pool
=
popen_helper
.
get_forkpool
(
3
,
closing
=
False
)
else
:
pool
=
popen_helper
.
get_threadpool
(
1
,
closing
=
False
)
atexit
.
register
(
pool
.
close
)
args
=
[(
self
.
_elements_in_epoch
,
stat_utils
.
random_int32
())
for
_
in
range
(
self
.
_maximum_number_epochs
)]
...
...
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