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
2708db70
Commit
2708db70
authored
Sep 27, 2019
by
A. Unique TensorFlower
Browse files
Internal change
PiperOrigin-RevId: 271611082
parent
d735ecf8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
official/recommendation/movielens.py
official/recommendation/movielens.py
+3
-2
No files found.
official/recommendation/movielens.py
View file @
2708db70
...
@@ -40,6 +40,7 @@ import tensorflow as tf
...
@@ -40,6 +40,7 @@ import tensorflow as tf
from
official.utils.flags
import
core
as
flags_core
from
official.utils.flags
import
core
as
flags_core
ML_1M
=
"ml-1m"
ML_1M
=
"ml-1m"
ML_20M
=
"ml-20m"
ML_20M
=
"ml-20m"
DATASETS
=
[
ML_1M
,
ML_20M
]
DATASETS
=
[
ML_1M
,
ML_20M
]
...
@@ -151,7 +152,7 @@ def _transform_csv(input_path, output_path, names, skip_first, separator=","):
...
@@ -151,7 +152,7 @@ def _transform_csv(input_path, output_path, names, skip_first, separator=","):
separator: Character used to separate fields in the raw csv.
separator: Character used to separate fields in the raw csv.
"""
"""
if
six
.
PY2
:
if
six
.
PY2
:
names
=
[
n
.
decode
(
"utf-8"
)
for
n
in
names
]
names
=
[
six
.
ensure_text
(
n
,
"utf-8"
)
for
n
in
names
]
with
tf
.
io
.
gfile
.
GFile
(
output_path
,
"wb"
)
as
f_out
,
\
with
tf
.
io
.
gfile
.
GFile
(
output_path
,
"wb"
)
as
f_out
,
\
tf
.
io
.
gfile
.
GFile
(
input_path
,
"rb"
)
as
f_in
:
tf
.
io
.
gfile
.
GFile
(
input_path
,
"rb"
)
as
f_in
:
...
@@ -163,7 +164,7 @@ def _transform_csv(input_path, output_path, names, skip_first, separator=","):
...
@@ -163,7 +164,7 @@ def _transform_csv(input_path, output_path, names, skip_first, separator=","):
if
i
==
0
and
skip_first
:
if
i
==
0
and
skip_first
:
continue
# ignore existing labels in the csv
continue
# ignore existing labels in the csv
line
=
line
.
decode
(
"utf-8"
,
errors
=
"ignore"
)
line
=
six
.
ensure_text
(
line
,
"utf-8"
,
errors
=
"ignore"
)
fields
=
line
.
split
(
separator
)
fields
=
line
.
split
(
separator
)
if
separator
!=
","
:
if
separator
!=
","
:
fields
=
[
'"{}"'
.
format
(
field
)
if
","
in
field
else
field
fields
=
[
'"{}"'
.
format
(
field
)
if
","
in
field
else
field
...
...
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