by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Stefan Falk
    @stefan-falk
    Is here anybody who used audio_preproc_in_bottom and set it to True (default is False). I am currently trying this but it seems to be that there might be something broken? I opened a github issue: tensorflow/tensor2tensor#1743
    Bartłomiej Lewandowski
    @BartlomiejLewandowski

    Hi folks, I'm trying to run an example colab book that shows the librispeech pretrained transformer. The link I've found is here: https://colab.research.google.com/github/tensorflow/tensor2tensor/blob/master/tensor2tensor/notebooks/asr_transformer.ipynb#scrollTo=rRso42LnRDXF

    I had struggled to run at it first (had to pip install the newest version which would import models correctly). Now I'm stuck at the decoding part, it seems that the fetched checkpoint does not match the model that is being used. Any suggestions if I can use the checkpoint provided there? Are there any others that have been updated? Am I correct in assuming that this mismatch is indeed the problem? Cheers

    This is what the error is : NotFoundError: transformer/symbol_modality_256_384/shared/weights_0 not found in checkpoint

    Bartłomiej Lewandowski
    @BartlomiejLewandowski
    I've managed to resolve this by including specifying other versions of tensorflow, tensor2tensor and tensor-probability:
    !pip install tensorflow==1.14.0
    !pip install tensor2tensor==1.11.0
    !pip install tensorflow-probability==0.7.0
    Checkpoint works well, I've uploaded a short utterance and it recognized the words perfectly, Cheers!
    Stefan Falk
    @stefan-falk
    Does anybody know what hparams.num_zeropad_frames is used for (SpeechRecognition)? Obviously, it pads samples with zeros. But is there a particular reason why we have to zero-pad our samples?
    Stefan Falk
    @stefan-falk
    All I know is that it does not make sure samples have equal length so I wonder.. Mainly because it effects how much memory we need for samples.
    JP Zhang
    @zjplab
    image.png
    How to debug Tensor2Tensor 1.11? I want to know where this kind of error occurred.
    w4-chanbae
    @w4-chanbae
    Hi all, I'm trying to use the output of a pretrained lstm_seq2seq language model to help a transformer model for speech recognition decode. I tried initialising the language model inside the transformer model's init function and restoring weights from a separate checkpoint (as they do with the teacher/student models in tensor2tensor/models/distillation.py), but whatever saver is trying to restore transformer weights for decoding seems to be trying to restore the language model weights as well from the transformer checkpoint, which it obviously can't find, throwing an error and killing the program. What's the best way to load two t2t models at the same time?
    Stefan Falk
    @stefan-falk

    @zjplab So, I really don't know if that's the best way to do it but I created a train.py script which simply calls t2t_trainer.main(None). In order for this to work you have to make sure that sys.args looks the way t2t expects it to e.g.

    import sys
    # ..
    args = get_args()
    t2t_args = [
      '--generate_data',
      '--data_dir', args.data_dir,
      '--tmp_dir', args.tmp_dir,
      # ..
    ]
    sys.argv = sys.argv[:1] + t2t_args
    t2t_trainer.main(None)

    There might be better ways but I can live with that.

    Now you can run and debug train.py.

    JP Zhang
    @zjplab
    @stefan-falk Thanks. Actually this kind of occurs during running t2t_trainer. Do you know any method to stop and let me inspect?
    Stefan Falk
    @stefan-falk
    @zjplab Not sure if I understand correctly. You'd run train.py in debug mode using the IDE of your choice. Or what do you mean by "inspect"?
    Or you'd just run t2t_trainer.py using a debugger.
    Stefan Falk
    @stefan-falk

    Does anybody know how we can read tf.string fields from shards? E.g.

    def example_reading_spec(self):
    
        data_fields = {
            # ..
            'dataset_name': tf.FixedLenFeature((), tf.string)
        }
    
        data_items_to_decoders = None
        return data_fields, data_items_to_decoders

    As soon as I add this to the desired fields, I am getting ValueError: slice index 0 of dimension 0 out of bounds..

    Do I have to provide a decoder for data_items_to_decoders?

    emesha92
    @emesha92
    If i want to ask something regarding trax, should i do it here or we have another channel? @lukaszkaiser @rsepassi
    Yanay Lehavi
    @Lehavi
    @Lehavi
    Hi, I have an install problem and would appreciate any help:
    I'm on a Mac Catalina, installed TensorFlow, and it looks fine. Installed t2t using pip install tensor2tensor, no complaint from the OS.
    Trying to run t2t-trainer I get:
    AttributeError: module 'tensorflow' has no attribute 'variable_scope'
    Anyone can help? Many thanks!
    Lukasz Kaiser
    @lukaszkaiser
    @emesha92 : for trax please use this room: https://gitter.im/trax-ml/community
    @Lehavi : I think you have TF 2. For Tensor2Tensor you need TF1, e.g., pip install tensorflow==1.15 ; TF2 is the reason we have trax :)
    tavanduy
    @tavanduy
    Hello, has anyone used t2t transformer for punctuation restoration? My inputs are unpunctuated sentences and outputs are labels. But the longer the model trains, the less COMMA labels appear in decoded test set which is weird.
    Regalia
    @RegaliaXYZ
    @lukaszkaiser would you happen to know which versions of tensorflow/tensor2tensor etc do I need to resume training on the ASR english pre trained model that you made available? Because with my current versions I get a weight_0 not found in checkpoint error that is probably due to a version mismatch
    Bedapudi Praneeth
    @bedapudi6788

    Hi all, I am experimenting with a speech to text model trained using tensor2tensor (not by me). I only have access to saved_model format generated using t2t-export and the vocab for decoding.

    Is it possible to change the decoding params of the exported model?
    Is there some way to see all the beam outputs instead of the top scoring one?

    Any help/suggestions are appreciated. Thank you.

    py4_
    @py4
    @lukaszkaiser I guess there is a dimension mismatch problem for img2img transformer when the mode is PREDICT (it works on EVAL or TRAIN): tensorflow/tensor2tensor#1797
    Kapil Gupta
    @daemonslayer
    How do I retrain a trained model using tensor2tensor?
    HaibaraAi
    @AiHaibara
    I have a question for why setting the ALPHA = 0.1 or 0.3 hparams.learning_rate = ALPHA and train it, but in tensorboard learning_rate is only 2e-4
    HaibaraAi
    @AiHaibara
    image.png
    image.png
    James Hirschorn
    @quantitative-technologies

    Hello,

    I am trying to define by own Text2TextProblem with vocab_type TOKEN. Are there any existing problems of this type to help me figure out how to get it working?

    James Hirschorn
    @quantitative-technologies
    The diaglog_* problems are Text2TextProblem with TOKEN vocabulary.
    Lukasz Kaiser
    @lukaszkaiser
    @AiHaibara : I think you may need to set hparams.learning_rate_constant -- sorry for the confusion!~
    @quantitative-technologies : I think some LM problems like PTB may be TOKEN too? It should be very similar to SUBWORD...
    James Hirschorn
    @quantitative-technologies
    Yes, that is true. But it was easy to figure out how to use TOKEN by looking at the dialog problem. I'm actually not sure what SUBWORD is, but for my problem with symbolic reasoning TOKEN was definitely what I needed.
    Bedapudi Praneeth
    @bedapudi6788
    Hi all, does anyone know if getting token level scores is possible in tensor2tensor.
    I am working on a machine translation task, where I want to mark the words with low confidence.
    James Hirschorn
    @quantitative-technologies

    When I train my transformer using t2t-trainer, I see the targets/accuracy go up to around 65% on tensorboard. But then when I try:

    t2t-decoder --data_dir=$DATA_DIR --problem=$PROBLEM --model=$MODEL --hparams_set=$HPARAMS --output_dir=$TRAIN_DIR --t2t_usr_dir='.'

    It looks like none of the OUTPUTs matches the corresponding TARGETs. Am I missing something obvious?

    Lukasz Kaiser
    @lukaszkaiser
    @bedapudi6788 : are you asking for sth like the TransformerScorer model? https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/models/transformer.py#L1302
    @quantitative-technologies : Transformer is autoregressive, so at 65% accuracy it may not produce any fully identical sequence at decoding time; but normally it should give some reasonable output...?
    James Hirschorn
    @quantitative-technologies

    @lukaszkaiser Yes, the output is "reasonable" about 2/3 of the time. But then what does the 65% refer to?

    I am still learning about the transformer architecture so maybe it will become clear with further reading.

    Lukasz Kaiser
    @lukaszkaiser
    The 65% is per-symbol accuracy of eval; at eval, you do get the ground truth (so all correct symbols) upto time t, and you predict symbol at t+1; at infer, there are no "correct" symbols so you predict t+1 from what you generated upto time t -- so it's usually less accurate than eval
    Bedapudi Praneeth
    @bedapudi6788
    @lukaszkaiser Thank you! I think that's exactly what I need. I will try to figure out how to use that class.
    James Hirschorn
    @quantitative-technologies
    @lukaszkaiser Thanks! I should have guessed that. So I assume that targets/accuracy_per_sequence is the accuracy of predicting the entire target sequence. How about targets/accuracy_top5? My guess is that it is either the accuracy of getting one of the top 5 symbols correct, or perhaps the accuracy of getting all of the top 5 symbols correct. I will have to check the code...
    Lukasz Kaiser
    @lukaszkaiser
    You're right! top_5 is getting the correct one in the top5 (so it's always higher than accuracy)
    Giovanni-Alzetta
    @Giovanni-Alzetta
    Hi everyone! I have a question about the hparam "num_trainable_top_decoder_layers"; I have found it into the evolved transformer. I am expecting it to freeze a certain number of layers for transfer learning, but reading the code I cannot fully grasp what it does when it calls the function "tf.stop_gradient"...could someone please help me? Thank you!
    Anton Kretov
    @anton_kretov_twitter
    Hi everyone! What T2T model has the same architecture as trax Transformer model? Seems like they are all different basing on their parameters number.
    Lukasz Kaiser
    @lukaszkaiser
    @anton_kretov_twitter : as said above, it may be tricky to get that...
    @Giovanni-Alzetta : stop_gradient(x) is just x on the forward pass, but stops all gradient propagation through x on the backward pass... sorry if that's tricky, it is a bit...
    KosayJabre
    @KosayJabre
    Hi, anyone here?
    I'm trying to use a pretrained character level language model, but I keep getting the last character of my input as the output
    I've submitted an issue here tensorflow/tensor2tensor#1808
    Any help or tips would be appreciated
    Lukasz Kaiser
    @lukaszkaiser
    Hi @KosayJabre - I don't think I can help with that, as tensor2tensor is now in maintenance mode... we've switched to Trax, that's where we help and debug.
    Giovanni-Alzetta
    @Giovanni-Alzetta
    @lukaszkaiser Thank you for your answer! Indeed that's a bit tricky...