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
ModelZoo
ResNet50_tensorflow
Commits
ac6ab360
Unverified
Commit
ac6ab360
authored
Mar 11, 2018
by
Mark Daoust
Committed by
GitHub
Mar 11, 2018
Browse files
Merge pull request #3260 from lc0/dataset
Fix a typo. Python function name
parents
3f78f4cf
f8e854b5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
samples/outreach/blogs/blog_estimators_dataset.py
samples/outreach/blogs/blog_estimators_dataset.py
+5
-4
No files found.
samples/outreach/blogs/blog_estimators_dataset.py
View file @
ac6ab360
...
...
@@ -38,7 +38,7 @@ URL_TRAIN = "http://download.tensorflow.org/data/iris_training.csv"
URL_TEST
=
"http://download.tensorflow.org/data/iris_test.csv"
def
download
D
ataset
(
url
,
file
):
def
download
_d
ataset
(
url
,
file
):
if
not
os
.
path
.
exists
(
PATH_DATASET
):
os
.
makedirs
(
PATH_DATASET
)
if
not
os
.
path
.
exists
(
file
):
...
...
@@ -46,8 +46,8 @@ def downloadDataset(url, file):
with
open
(
file
,
"wb"
)
as
f
:
f
.
write
(
data
)
f
.
close
()
download
D
ataset
(
URL_TRAIN
,
FILE_TRAIN
)
download
D
ataset
(
URL_TEST
,
FILE_TEST
)
download
_d
ataset
(
URL_TRAIN
,
FILE_TRAIN
)
download
_d
ataset
(
URL_TEST
,
FILE_TEST
)
tf
.
logging
.
set_verbosity
(
tf
.
logging
.
INFO
)
...
...
@@ -97,7 +97,7 @@ classifier = tf.estimator.DNNClassifier(
n_classes
=
3
,
model_dir
=
PATH
)
# Path to where checkpoints etc are stored
# Train our model, use the previously function my_input_fn
# Train our model, use the previously
defined
function my_input_fn
# Input to training is a file with training example
# Stop training after 8 iterations of train data (epochs)
classifier
.
train
(
...
...
@@ -127,6 +127,7 @@ prediction_input = [[5.9, 3.0, 4.2, 1.5], # -> 1, Iris Versicolor
[
6.9
,
3.1
,
5.4
,
2.1
],
# -> 2, Iris Virginica
[
5.1
,
3.3
,
1.7
,
0.5
]]
# -> 0, Iris Sentosa
def
new_input_fn
():
def
decode
(
x
):
x
=
tf
.
split
(
x
,
4
)
# Need to split into our 4 features
...
...
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