emanjavacas / pie

A fully-fledge PyTorch package for Morphological Analysis, tailored to morphologically rich and historical languages.
MIT License
22 stars 10 forks source link

Using Cuda ? #36

Closed mryolanda closed 4 years ago

mryolanda commented 4 years ago

Hi ! Thanks for your development! I would like to experiment a bit pie, and you are mentioning the fact we can choose our device, but when I write :

PIE_DEVICE=cuda:0

I have the following error :

pie train config.json PIE_DEVICE=cuda:0
fatal: not a git repository (or any of the parent directories): .git
Usage: pie train [OPTIONS] CONFIG_PATH
Try "pie train --help" for help.
Error: Got unexpected extra argument (PIE_DEVICE=cuda:0)

I also have tried to change the device by default in pie/default_settings.json but the GPU is still not used.

Thanks !

emanjavacas commented 4 years ago

Hi! This kind of parameter passing through environment variables goes at the very beginning of the command. Try something like this:

PIE_DEVICE=cuda:0 pie train config.json

Using the config file should also work. Let me know if you get it to work!

mryolanda commented 4 years ago

Your solution works, thank you very much !