Coder Social home page Coder Social logo

Comments (5)

hiteshvaidya avatar hiteshvaidya commented on May 16, 2024 3

So, I googled a bit and found the solution. Tensorflow, keras by default takes all the available GPUs. If we want to avoid that then we can tweak the settings. Just for your information, following are the links to how that can be done,
keras-team/keras#6031
https://www.tensorflow.org/programmers_guide/using_gpu

Also, we can run the program as,
python <program_name> --num_gpus=<no._of_GPUs_u_want_2_allocate>
This will take the first 2 GPUs for execution as tensorflow considers GPUs in numeric order.

from nmt-keras.

hiteshvaidya avatar hiteshvaidya commented on May 16, 2024 2

Thank you so much for your help. I made following changes as per your suggestion and I am able to train.
MAX_INPUT_TEXT_LEN = 100
MAX_OUTPUT_TEXT_LEN = 100
INPUT_VOCABULARY_SIZE = 50000
OUTPUT_VOCABULARY_SIZE = 50000
BATCH_SIZE = 50

However, I didn't find any option for setting the parameters like gpuid or multiple gpuids etc. Please let me know if there is any way to put a control on the use of GPUs. The above experiment that I told was running on 3 GPUs but still showed 10 hours for completing just one epoch. I don't think it should take that much time because in the past I had run few experiments on OpenNMT backend using the same corpus and it didn't take so much time.

Thank you.

from nmt-keras.

lvapeab avatar lvapeab commented on May 16, 2024

It seems you have a way too large vocabulary (394054 words!).

You must use a shortlist of the vocabulary (e.g. keep the top-K frequent words, mapping the rest to an unknown token). You can easily set this with the INPUT_VOCABULARY_SIZE and OUTPUT_VOCABULARY_SIZE options.

Moreover, the options MAX_INPUT_TEXT_LEN = 11351 MAX_OUTPUT_TEXT_LEN = 7898 indicate the max number of words allowed in each sentence. You probably want to reduce this number (to e.g. 80 words (this depends on your corpora).

Finally, I recommend you to have a look to sub-word preprocessing methods, such as byte-pair-encoding, which are effective when dealing with large vocabularies.

from nmt-keras.

lvapeab avatar lvapeab commented on May 16, 2024

This is probably related to your Keras'/Tensorflow configuration.
I've never tried multi-gpu configuration, but on a single GPU, it should work.

from nmt-keras.

lvapeab avatar lvapeab commented on May 16, 2024

Thanks for the info ^^

from nmt-keras.

Related Issues (20)

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.