Comments (6)
Now, I got it. The problem was that the new file to be translated had not been preprocessed with the .bpe file used for training. After running the .bpe over it, it's working!
from tensor2tensor.
Thanks for finding the fix!
from tensor2tensor.
Hi @lukaszkaiser , @mehmedes
I found this "issue", too. I understand that this is not a bug, because you might be able to guarantee the processed training data doesn't contain any OOV word. But I think it would be more flexible if (As I said in this issue):
- More detailed README to make users easier to run experiments without triggering such exception.
- Or, rewriting the codes a little bit, like,
def encode(self, sentence):
"""Converts a space-separated string of tokens to a list of ids."""
ret = [self._token_to_id[tok] if tok in self._token_to_id \
else self._token_to_id['UNK'] for tok in sentence.strip().split()]
return ret[::-1] if self._reverse else ret
to avoid this exception.
Thank you so much
from tensor2tensor.
Is this BPE-only or does it happen with tokens_32k too? We would prefer not to build any special support for external BPE as it's hard to maintain (needs perl scripts) and isn't invertible.
from tensor2tensor.
Hi @lukaszkaiser
Thank you.
If I ran the bulit-in problems such as tokens_32k
or bpe_32k
, it works well without corruption.
What I want to say is that, if a user want to use his/her own vocabulary, and the training data contains OOVs, it might raise this exception.
I haven't tried to use my own vocabularies to run the token_32k
experiment, but I think there might be such problems, too. I'll try it and let you know if any progress.
from tensor2tensor.
We try to include every character in the vocabulary in "tokens_XX" -- so hopefully it should handle at least all words composed of characters that appear in the training data. Please reopen if you see the problem again!
from tensor2tensor.
Related Issues (20)
- Can't create experiment
- What is suitable version of tensorflow for current tensor2tensor version(1.15.7)?
- Error when deploy tensor2tensor model after training
- Moving MNIST frame prediction using SV2P or Emily
- Comparison of OpenNMT-tf and tensor2tensor
- Use of Layer Normalization
- AttributeError: 'DummyModule' object has no attribute 'load_checkpoint'
- Unable to instantiate problem instance when calling use_vocab_from_other_problem
- Error: AttributeError: module 'tensorflow.compat.v2.__internal__' has no attribute 'monitoring'
- Colab notebook breaking after TF1 support removed HOT 1
- Question about bleu evaluation HOT 1
- AttributeError: 'AdafactorOptimizer' object has no attribute 'get_gradients' HOT 1
- Aadm is slower than Adafactor
- AttributeError: module 'tensorflow' has no attribute 'flags'
- 'NoneType' object has no attribute 'copy' HOT 1
- Potential bug in timing embedding
- Tensor2Tensor Intro notebook giving errors while running cell 4
- Absolute Position Encoding:Why are the two tensors not alternately merged? HOT 2
- Migrating T2T to TF2
- RuntimeError: There was no new checkpoint after the training. Eval status: missing checkpoint
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tensor2tensor.