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
268347eb
Commit
268347eb
authored
Dec 19, 2017
by
Mark Daoust
Browse files
use six for urlopen
parent
e1a1328c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
samples/outreach/blogs/Blog_Custom_Estimators.py
samples/outreach/blogs/Blog_Custom_Estimators.py
+2
-5
No files found.
samples/outreach/blogs/Blog_Custom_Estimators.py
View file @
268347eb
...
@@ -21,10 +21,7 @@ import tensorflow as tf
...
@@ -21,10 +21,7 @@ import tensorflow as tf
import
os
import
os
import
sys
import
sys
if
sys
.
version_info
<
(
3
,
0
,
0
):
import
six.moves.urllib.request
as
request
from
urllib
import
urlopen
else
:
from
urllib.request
import
urlopen
tf
.
logging
.
set_verbosity
(
tf
.
logging
.
INFO
)
tf
.
logging
.
set_verbosity
(
tf
.
logging
.
INFO
)
...
@@ -47,7 +44,7 @@ def downloadDataset(url, file):
...
@@ -47,7 +44,7 @@ def downloadDataset(url, file):
if
not
os
.
path
.
exists
(
PATH_DATASET
):
if
not
os
.
path
.
exists
(
PATH_DATASET
):
os
.
makedirs
(
PATH_DATASET
)
os
.
makedirs
(
PATH_DATASET
)
if
not
os
.
path
.
exists
(
file
):
if
not
os
.
path
.
exists
(
file
):
data
=
urlopen
(
url
).
read
()
data
=
request
.
urlopen
(
url
).
read
()
with
open
(
file
,
"wb"
)
as
f
:
with
open
(
file
,
"wb"
)
as
f
:
f
.
write
(
data
)
f
.
write
(
data
)
f
.
close
()
f
.
close
()
...
...
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