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
2b2e12ed
Commit
2b2e12ed
authored
Dec 21, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor update
parent
552ec9e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
examples/ResNet/cifar10-preact18-mixup.py
examples/ResNet/cifar10-preact18-mixup.py
+2
-2
tensorpack/dataflow/prefetch.py
tensorpack/dataflow/prefetch.py
+4
-0
No files found.
examples/ResNet/cifar10-preact18-mixup.py
View file @
2b2e12ed
...
@@ -130,8 +130,8 @@ def get_data(train_or_test, isMixup, alpha):
...
@@ -130,8 +130,8 @@ def get_data(train_or_test, isMixup, alpha):
batch
=
BATCH_SIZE
batch
=
BATCH_SIZE
ds
=
BatchData
(
ds
,
batch
,
remainder
=
not
isTrain
)
ds
=
BatchData
(
ds
,
batch
,
remainder
=
not
isTrain
)
def
f
(
d
s
):
def
f
(
d
p
):
images
,
labels
=
d
s
images
,
labels
=
d
p
one_hot_labels
=
np
.
eye
(
CLASS_NUM
)[
labels
]
# one hot coding
one_hot_labels
=
np
.
eye
(
CLASS_NUM
)[
labels
]
# one hot coding
if
not
isTrain
or
not
isMixup
:
if
not
isTrain
or
not
isMixup
:
return
[
images
,
one_hot_labels
]
return
[
images
,
one_hot_labels
]
...
...
tensorpack/dataflow/prefetch.py
View file @
2b2e12ed
...
@@ -97,6 +97,7 @@ class _MultiProcessZMQDataFlow(DataFlow):
...
@@ -97,6 +97,7 @@ class _MultiProcessZMQDataFlow(DataFlow):
if
not
self
.
_reset_done
:
if
not
self
.
_reset_done
:
return
return
if
not
self
.
context
.
closed
:
if
not
self
.
context
.
closed
:
self
.
socket
.
close
(
0
)
self
.
context
.
destroy
(
0
)
self
.
context
.
destroy
(
0
)
for
x
in
self
.
_procs
:
for
x
in
self
.
_procs
:
x
.
terminate
()
x
.
terminate
()
...
@@ -239,6 +240,9 @@ class PrefetchDataZMQ(_MultiProcessZMQDataFlow):
...
@@ -239,6 +240,9 @@ class PrefetchDataZMQ(_MultiProcessZMQDataFlow):
# sigint could still propagate here, e.g. when nested
# sigint could still propagate here, e.g. when nested
except
KeyboardInterrupt
:
except
KeyboardInterrupt
:
pass
pass
finally
:
socket
.
close
(
0
)
context
.
destroy
(
0
)
def
__init__
(
self
,
ds
,
nr_proc
=
1
,
hwm
=
50
):
def
__init__
(
self
,
ds
,
nr_proc
=
1
,
hwm
=
50
):
"""
"""
...
...
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