hipster-philology / pandora

A Tagger-Lemmatizer for Natural Languages
MIT License
9 stars 4 forks source link

How to handle gpu #47

Closed emanjavacas closed 7 years ago

emanjavacas commented 7 years ago

We should pass params to the model defining whether to use gpu and which gpu to use.

PonteIneptique commented 7 years ago

Could we have by default some kind of autodetect ? This would make sense for the CLI at least.

emanjavacas commented 7 years ago

Sure, it could be part of the model interface, since this is framework dependent.

On 2 Oct 2017 9:16 a.m., "Thibault Clérice" notifications@github.com wrote:

Could we have by default some kind of autodetect ? This would make sense for the CLI at least.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hipster-philology/pandora/issues/47#issuecomment-333457456, or mute the thread https://github.com/notifications/unsubscribe-auth/AF6Ho0yK6e_ej6qmiRxYYjsUrVYfKqP7ks5soI3kgaJpZM4PqADd .

PonteIneptique commented 7 years ago

I might have an issue with GPU actually :

Traceback (most recent call last):
  File "/home/thibault/dev/pandora-dev/env/bin/pandora-train", line 11, in <module>
    load_entry_point('pandora', 'console_scripts', 'pandora-train')()
  File "/home/thibault/dev/pandora-dev/pandora/cli.py", line 144, in cli_train
    train_func(**vars(parser.parse_args()))
  File "/home/thibault/dev/pandora-dev/pandora/cli.py", line 112, in train_func
    tagger.epoch(autosave=True, eval_test=tagger.include_test)
  File "/home/thibault/dev/pandora-dev/pandora/tagger.py", line 496, in epoch
    self.model.epoch(train_in, train_out)
  File "/home/thibault/dev/pandora-dev/pandora/impl/pytorch/model.py", line 290, in epoch
    src, trg = batches[batch]
  File "/home/thibault/dev/pandora-dev/pandora/impl/pytorch/utils.py", line 50, in __getitem__
    src = src.cuda()
AttributeError: 'dict' object has no attribute 'cuda'

when setting gpu to True

emanjavacas commented 7 years ago

I haven't tested on the GPU yet. I will work on that and hopefully we will have a way to do GPU detection for the interface

On 2 Oct 2017 9:27 a.m., "Thibault Clérice" notifications@github.com wrote:

I might have an issue with GPU actually :

Traceback (most recent call last): File "/home/thibault/dev/pandora-dev/env/bin/pandora-train", line 11, in load_entry_point('pandora', 'console_scripts', 'pandora-train')() File "/home/thibault/dev/pandora-dev/pandora/cli.py", line 144, in cli_train train_func(**vars(parser.parse_args())) File "/home/thibault/dev/pandora-dev/pandora/cli.py", line 112, in train_func tagger.epoch(autosave=True, eval_test=tagger.include_test) File "/home/thibault/dev/pandora-dev/pandora/tagger.py", line 496, in epoch self.model.epoch(train_in, train_out) File "/home/thibault/dev/pandora-dev/pandora/impl/pytorch/model.py", line 290, in epoch src, trg = batches[batch] File "/home/thibault/dev/pandora-dev/pandora/impl/pytorch/utils.py", line 50, in getitem src = src.cuda() AttributeError: 'dict' object has no attribute 'cuda'

when setting gpu to True

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hipster-philology/pandora/issues/47#issuecomment-333459348, or mute the thread https://github.com/notifications/unsubscribe-auth/AF6HoyW-3TMZyDw6vz9LtQtuXsWcbKzoks5soJB3gaJpZM4PqADd .

emanjavacas commented 7 years ago

I've added discovery mechanism to pytorch model