tensorflow / tensorflow/datasets
Specify TokenTextEncoder with custom tokenizer makes dataset reusing failed
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 1.6k
- Avg merge
- 3h 54m
- Merged PRs (30d)
- 1
Description
Short description
Description of the bug.
Environment information
- Operating System: Ubuntu 16.04
- Python version: 3.6.8
tensorflow-datasets/tfds-nightlyversion: 1.0.2tensorflow/tensorflow-gpu/tf-nightly/tf-nightly-gpuversion: 1.13.1
Reproduction instructions
BUILDER_CONFIGS = [
DatasetConfig(
name="words",
version="1.0.0",
description=("Uses word-level text encoding with "
"`tfds.features.text.TokenTextEncoder`"),
text_encoder_config=tfds.features.text.TextEncoderConfig(
encoder=tfds.features.text.TokenTextEncoder(
vocab_list=VOCAB,
tokenizer=Tokenizer(reserved_tokens=VOCAB))),
),
]
Link to logs
tensorflow.python.framework.errors_impl.NotFoundError: tensorflow_datasets/tacotron_dataset/phones/1.0.0.incompleteGTGY8F/text.text.tokens.tokenizer; No such file or directory
Expected behavior
Dataset can be reused when rerunning.
Additional context
When custom tokenizer is specified, it's saved to file for reusing. (https://github.com/tensorflow/datasets/blob/master/tensorflow_datasets/core/features/text/text_encoder.py#L331). But when reusing happens, it seems that wrong path is used to load tokenizer from file.
if self._user_defined_tokenizer is not None:
self._tokenizer.save_to_file(filename)
kwargs["tokenizer_file_prefix"] = filename
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect tensorflow_datasets/core/features/text/text_encoder.py around the custom tokenizer save and load logic, then reproduce the failure with the TokenTextEncoder and custom Tokenizer configuration shown. Done means a dataset using this configuration can be reused on rerun without the tokenizer path NotFoundError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, tensorflow
- Domain
- data, machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100