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
0641ef09
You need to sign in or sign up before continuing.
Commit
0641ef09
authored
Dec 03, 2018
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix MultiThreadPrefetchData
parent
a1da74af
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
tensorpack/callbacks/inference_runner.py
tensorpack/callbacks/inference_runner.py
+2
-2
tensorpack/dataflow/parallel.py
tensorpack/dataflow/parallel.py
+5
-4
No files found.
tensorpack/callbacks/inference_runner.py
View file @
0641ef09
...
...
@@ -63,13 +63,13 @@ class InferenceRunnerBase(Callback):
Note:
1. InferenceRunner will use `input.size()` to determine
how much iterations to run, so you're responsible to ensure that
`input.size()` is
reasonabl
e.
`input.size()` is
accurat
e.
2. Only works with instances of `TowerTrainer`.
"""
def
__init__
(
self
,
input
,
infs
):
"""
Args:
input (InputSource): the input to use. Must have ``size()``.
input (InputSource): the input to use. Must have
an accurate
``size()``.
infs (list[Inferencer]): list of :class:`Inferencer` to run.
"""
self
.
_input_source
=
input
...
...
tensorpack/dataflow/parallel.py
View file @
0641ef09
...
...
@@ -363,10 +363,11 @@ class MultiThreadPrefetchData(DataFlow):
def
run
(
self
):
self
.
df
.
reset_state
()
try
:
for
dp
in
self
.
df
:
if
self
.
stopped
():
return
self
.
queue_put_stoppable
(
self
.
queue
,
dp
)
while
True
:
for
dp
in
self
.
df
:
if
self
.
stopped
():
return
self
.
queue_put_stoppable
(
self
.
queue
,
dp
)
except
Exception
:
if
self
.
stopped
():
pass
# skip duplicated error messages
...
...
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