Giter Site home page Giter Site logo

annotated-transformer_codes's People

Contributors

ernichol avatar ictnlp-wshugen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

annotated-transformer_codes's Issues

Train with custom dataset

Hi, I am pretty new here. I would like to know how do we provide the dataset instead of using the one that comes with the library. I have a parallel corpus that is stored in two text files as source.txt and target.txt. I see all the annotated transformer model use the dataset that comes with the library and not with a custom dataset. Please provide a link or tutorial so that I can modify my dataset in order to feed into this model. Many Thanks.

AssertionError when running on 4 GPU's: len(modules) == len(inputs)

When running on 2 or 3 GPU's everything works fine. When running on 4 GPU's however, during the first epoch:

Epoch step: 1 Loss 9.134843 Tokens per Sec: 161.252618
Traceback (most recent call last):
  File "realworld.py", line 83, in <module>
    MultiGPULossCompute(model.generator, criterion, devices=devices, opt=model_opt))
  File "/export/home1/NoCsBack/hci/rubenc/transformer-v2/transformer/flow.py", line 53, in run_epoch
    for i, batch in enumerate(data_iter):
  File "realworld.py", line 82, in <genexpr>
    run_epoch((rebatch(pad_idx, b) for b in train_iter), model_par,
  File "/export/home1/NoCsBack/hci/rubenc/miniconda3/envs/transfenv/lib/python3.7/site-packages/torchtext/data/iterator.py", line 141, in __iter__
    self.init_epoch()
  File "/export/home1/NoCsBack/hci/rubenc/miniconda3/envs/transfenv/lib/python3.7/site-packages/torchtext/data/iterator.py", line 117, in init_epoch
    self.create_batches()
  File "/export/home1/NoCsBack/hci/rubenc/transformer-v2/transformer/my_iterator.py", line 18, in create_batches
    from realworld import dividable_size
  File "/export/home1/NoCsBack/hci/rubenc/transformer-v2/realworld.py", line 83, in <module>
    MultiGPULossCompute(model.generator, criterion, devices=devices, opt=model_opt))
  File "/export/home1/NoCsBack/hci/rubenc/transformer-v2/transformer/flow.py", line 55, in run_epoch
    loss = loss_compute(out, batch.trg_y, batch.ntokens)
  File "/export/home1/NoCsBack/hci/rubenc/transformer-v2/transformer/multi_gpu_loss_compute.py", line 35, in __call__
    gen = nn.parallel.parallel_apply(generator, out_column)
  File "/export/home1/NoCsBack/hci/rubenc/miniconda3/envs/transfenv/lib/python3.7/site-packages/torch/nn/parallel/parallel_apply.py", line 37, in parallel_apply
    assert len(modules) == len(inputs)
AssertionError

I suspect this has something to do with pytorch/pytorch#5587 or pytorch/pytorch#11793. Any tips?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.