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
OpenDAS
nni
Commits
4e2c0aad
Unverified
Commit
4e2c0aad
authored
Mar 25, 2020
by
chicm-ms
Committed by
GitHub
Mar 25, 2020
Browse files
Fix mnist-keras multi trials on same system data load (#2228)
parent
39f211c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
examples/trials/mnist-keras/mnist-keras.py
examples/trials/mnist-keras/mnist-keras.py
+3
-1
No files found.
examples/trials/mnist-keras/mnist-keras.py
View file @
4e2c0aad
...
@@ -63,7 +63,9 @@ def load_mnist_data(args):
...
@@ -63,7 +63,9 @@ def load_mnist_data(args):
'''
'''
Load MNIST dataset
Load MNIST dataset
'''
'''
(
x_train
,
y_train
),
(
x_test
,
y_test
)
=
mnist
.
load_data
()
mnist_path
=
os
.
path
.
join
(
os
.
environ
.
get
(
'NNI_OUTPUT_DIR'
),
'mnist.npz'
)
(
x_train
,
y_train
),
(
x_test
,
y_test
)
=
mnist
.
load_data
(
path
=
mnist_path
)
os
.
remove
(
mnist_path
)
x_train
=
(
np
.
expand_dims
(
x_train
,
-
1
).
astype
(
np
.
float
)
/
255.
)[:
args
.
num_train
]
x_train
=
(
np
.
expand_dims
(
x_train
,
-
1
).
astype
(
np
.
float
)
/
255.
)[:
args
.
num_train
]
x_test
=
(
np
.
expand_dims
(
x_test
,
-
1
).
astype
(
np
.
float
)
/
255.
)[:
args
.
num_test
]
x_test
=
(
np
.
expand_dims
(
x_test
,
-
1
).
astype
(
np
.
float
)
/
255.
)[:
args
.
num_test
]
...
...
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