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
13e3c39a
Commit
13e3c39a
authored
Jul 06, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TENSORPACK_PIPEDIR
parent
12a7b7ff
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
tensorpack/dataflow/prefetch.py
tensorpack/dataflow/prefetch.py
+5
-2
tensorpack/predict/common.py
tensorpack/predict/common.py
+1
-1
tensorpack/predict/concurrency.py
tensorpack/predict/concurrency.py
+1
-1
No files found.
tensorpack/dataflow/prefetch.py
View file @
13e3c39a
...
...
@@ -95,7 +95,7 @@ class PrefetchProcessZMQ(multiprocessing.Process):
class
PrefetchDataZMQ
(
ProxyDataFlow
):
""" Work the same as `PrefetchData`, but faster. """
def
__init__
(
self
,
ds
,
nr_proc
=
1
,
pipedir
=
'.'
):
def
__init__
(
self
,
ds
,
nr_proc
=
1
,
pipedir
=
None
):
"""
:param ds: a `DataFlow` instance.
:param nr_proc: number of processes to use. When larger than 1, order
...
...
@@ -111,7 +111,10 @@ class PrefetchDataZMQ(ProxyDataFlow):
self
.
context
=
zmq
.
Context
()
self
.
socket
=
self
.
context
.
socket
(
zmq
.
PULL
)
assert
os
.
path
.
isdir
(
pipedir
)
if
pipedir
is
None
:
pipedir
=
os
.
environ
.
get
(
'TENSORPACK_PIPEDIR'
,
'.'
)
assert
os
.
path
.
isdir
(
pipedir
),
pipedir
self
.
pipename
=
"ipc://{}/dataflow-pipe-"
.
format
(
pipedir
.
rstrip
(
'/'
))
+
str
(
uuid
.
uuid1
())[:
6
]
self
.
socket
.
set_hwm
(
5
)
# a little bit faster than default, don't know why
self
.
socket
.
bind
(
self
.
pipename
)
...
...
tensorpack/predict/common.py
View file @
13e3c39a
...
...
@@ -78,7 +78,7 @@ def get_predict_func(config):
if
config
.
input_data_mapping
is
None
:
input_map
=
input_vars
else
:
input_map
=
[
input_vars
[
k
]
for
k
in
config
.
input_data_mapping
]
input_map
=
[
input_vars
[
k
]
for
k
in
config
.
input_data_mapping
if
k
>=
0
]
# check output_var_names against output_vars
output_vars
=
get_vars_by_names
(
output_var_names
)
...
...
tensorpack/predict/concurrency.py
View file @
13e3c39a
...
...
@@ -150,7 +150,7 @@ class MultiThreadAsyncPredictor(object):
def
put_task
(
self
,
inputs
,
callback
=
None
):
"""
:param inputs: a data point (list of component) matching input_names (not batched)
:param callback: a callback to get called with the list of outputs
:param callback: a
thread-safe
callback to get called with the list of outputs
:returns: a Future of output."""
f
=
Future
()
if
callback
is
not
None
:
...
...
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