Closed NickleDave closed 1 year ago
Quoting myself from the forum post:
I need to think a little more about the right way to fix this. People should be able to say they want to use 'cpu' explicitly, so I don’t think it should be either 'cuda' or 'auto'. It might be better to just let people specify the 'accelerator' option directly in the config, file although this forces people to learn about Lightning.
From the traceback above I can see that 'cpu'
is actually a valid option for accelerator
.
So I think now I am actually +1 on just changing device
to accelerator and linking to the Lightning docs e.g. in docstrings.
We should favor being a lightweight transparent wrapper whenever possible instead of coming up with new conventions
Thank you for the nice solution, this will be very easy to implement.
Thank you @JacquelineGoe for reporting this bug on the forum!
I will be sure to add you as a contributor when we fix.
Will move this near the top of the to-do list -- we need to make a new alpha release soon anyway
I put in a temporary fix for this #693. I will need to publish a new release to PyPI before the fix is in the version installed by pip
and conda
. The long-term fix is as described in #691
@all-contributors please add @JacquelineGoe for bug
@NickleDave
I've put up a pull request to add @JacquelineGoe! :tada:
Fixed by #752
Describe the bug Running
vak train
with version 1.0.0a1 and the device set to'cpu'
causes a crash, as described in this forum post: https://forum.vocalpy.org/t/errors-in-training-and-predicting-when-the-newest-version-of-vak-is-installed/71It produces the following traceback:
As reported in the forum post, this probably affects all CLI commands besides prep: predict, eval, learncurve -- I did not verify though.
To Reproduce Steps to reproduce the behavior:
[TRAIN]
table that specifiesdevice = 'cpu'
(full file is attached)vak train config.toml
Expected behavior
vak train
should run without crashingDesktop (please complete the following information):
Additional context What's going on here is that:
get_default_trainer
get_trainer
, ifdevice
is not set tocuda
, we default toNone
, butNone
is not a valid option foraccelerator
(the argument used when instantiatingTrainer
) vocalpy/vak/blob/3dcce70030ae9b1fd6d040e055def0d656a7512e/src/vak/trainer.py#L60TeenyTweetyNet_train_audio_cbin_annot_notmat.zip