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
84165751
Commit
84165751
authored
Apr 09, 2020
by
A. Unique TensorFlower
Browse files
Create output directories for finetuning data preparation if they don't exist.
PiperOrigin-RevId: 305703696
parent
db6aca44
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
official/nlp/data/classifier_data_lib.py
official/nlp/data/classifier_data_lib.py
+1
-0
official/nlp/data/create_finetuning_data.py
official/nlp/data/create_finetuning_data.py
+2
-0
No files found.
official/nlp/data/classifier_data_lib.py
View file @
84165751
...
...
@@ -578,6 +578,7 @@ def file_based_convert_examples_to_features(examples, label_list,
output_file
):
"""Convert a set of `InputExample`s to a TFRecord file."""
tf
.
io
.
gfile
.
makedirs
(
os
.
path
.
dirname
(
output_file
))
writer
=
tf
.
io
.
TFRecordWriter
(
output_file
)
for
(
ex_index
,
example
)
in
enumerate
(
examples
):
...
...
official/nlp/data/create_finetuning_data.py
View file @
84165751
...
...
@@ -20,6 +20,7 @@ from __future__ import print_function
import
functools
import
json
import
os
from
absl
import
app
from
absl
import
flags
...
...
@@ -191,6 +192,7 @@ def main(_):
else
:
input_meta_data
=
generate_squad_dataset
()
tf
.
io
.
gfile
.
makedirs
(
os
.
path
.
dirname
(
FLAGS
.
meta_data_file_path
))
with
tf
.
io
.
gfile
.
GFile
(
FLAGS
.
meta_data_file_path
,
"w"
)
as
writer
:
writer
.
write
(
json
.
dumps
(
input_meta_data
,
indent
=
4
)
+
"
\n
"
)
...
...
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