Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SeetaResearch
/
Dragon
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 51056e19
authored
Jan 18, 2018
by
Ting PAN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the crash when terminating processes
1 parent
77179032
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
26 deletions
Dragon/python/dragon/core/workspace.py
Dragon/python/dragon/docs/contents/ops.rst
Dragon/python/dragon/io/blob_fetcher.py
Dragon/python/dragon/io/data_batch.py
Dragon/python/dragon/io/data_reader.py
Dragon/python/dragon/io/data_transformer.py
Dragon/python/setup.py
Dragon/python/dragon/core/workspace.py
View file @
51056e1
...
...
@@ -268,7 +268,7 @@ def FeedTensor(tensor, ndarray, force_cpu=False, dtype=None):
raise
TypeError
(
'The preset data type is {}, but force to {}.'
.
format
(
preset_dtype
,
dtype
))
auto_dtype
=
preset_dtype
ndarray
=
np
.
array
(
ndarray
,
dtype
=
auto_dtype
)
ndarray
=
np
.
array
(
ndarray
,
dtype
=
auto_dtype
,
copy
=
False
)
FeedTensorCC
(
name
,
ndarray
,
_stringify_proto
(
dev
))
...
...
Dragon/python/dragon/docs/contents/ops.rst
View file @
51056e1
...
...
@@ -137,6 +137,7 @@ List Brief
`Tile`_ Tile the input according to the given multiples.
`Pad`_ Pad the input according to the given paddings.
`Crop`_ Crop the input according to the given starts and ends.
`OneHot`_ Generate the one-hot representation of inputs.
`Flatten`_ Flatten the input along the given axes.
`Reshape`_ Reshape the dimensions of input.
`ExpandDims`_ ExpandDims interface of NDArray.
...
...
@@ -263,6 +264,7 @@ List Brief
.. _Repeat: operators/ndarray.html#dragon.operators.ndarray.Repeat
.. _Tile: operators/ndarray.html#dragon.operators.ndarray.Tile
.. _Pad: operators/ndarray.html#dragon.operators.ndarray.Pad
.. _OneHot: operators/ndarray.html#dragon.operators.ndarray.OneHot
.. _Flatten: operators/ndarray.html#dragon.operators.ndarray.Flatten
.. _Reshape: operators/ndarray.html#dragon.operators.ndarray.Reshape
.. _ExpandDims: operators/ndarray.html#dragon.operators.ndarray.ExpandDims
...
...
Dragon/python/dragon/io/blob_fetcher.py
View file @
51056e1
...
...
@@ -37,14 +37,6 @@ class BlobFetcher(Process):
self
.
Q_in
=
self
.
Q_out
=
None
self
.
daemon
=
True
def
cleanup
():
from
dragon.config
import
logger
logger
.
info
(
'Terminating BlobFetcher......'
)
self
.
terminate
()
self
.
join
()
import
atexit
atexit
.
register
(
cleanup
)
def
im_list_to_blob
(
self
):
"""Get image and label blobs.
...
...
Dragon/python/dragon/io/data_batch.py
View file @
51056e1
...
...
@@ -155,6 +155,21 @@ class DataBatch(object):
self
.
echo
()
def
cleanup
():
def
terminate
(
processes
):
for
process
in
processes
:
process
.
terminate
()
process
.
join
()
from
dragon.config
import
logger
logger
.
info
(
'Terminating BlobFetcher ......'
)
terminate
(
self
.
_fetchers
)
logger
.
info
(
'Terminating DataTransformer ......'
)
terminate
(
self
.
_transformers
)
logger
.
info
(
'Terminating DataReader......'
)
terminate
(
self
.
_readers
)
import
atexit
atexit
.
register
(
cleanup
)
def
get
(
self
):
"""Get a batch.
...
...
Dragon/python/dragon/io/data_reader.py
View file @
51056e1
...
...
@@ -53,14 +53,6 @@ class DataReader(Process):
self
.
Q_out
=
None
self
.
daemon
=
True
def
cleanup
():
from
dragon.config
import
logger
logger
.
info
(
'Terminating DataReader......'
)
self
.
terminate
()
self
.
join
()
import
atexit
atexit
.
register
(
cleanup
)
def
element
(
self
):
"""Get the value of current record.
...
...
Dragon/python/dragon/io/data_transformer.py
View file @
51056e1
...
...
@@ -70,14 +70,6 @@ class DataTransformer(Process):
self
.
Q_in
=
self
.
Q_out
=
None
self
.
daemon
=
True
def
cleanup
():
from
dragon.config
import
logger
logger
.
info
(
'Terminating DataTransformer......'
)
self
.
terminate
()
self
.
join
()
import
atexit
atexit
.
register
(
cleanup
)
def
transform_image_labels
(
self
,
serialized
):
"""Get image and labels from a serialized str.
...
...
Dragon/python/setup.py
View file @
51056e1
...
...
@@ -36,7 +36,7 @@ find_packages('dragon')
find_modules
()
setup
(
name
=
'dragon'
,
version
=
'0.2.1.
1
'
,
version
=
'0.2.1.
2
'
,
description
=
'Dragon: A Computation Graph Virtual Machine Based Deep Learning Framework'
,
url
=
'https://github.com/neopenx/Dragon'
,
author
=
'Ting Pan'
,
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment