Errors in training and predicting when the newest version of vak is installed


I found a bug: if you install vak with the newest version of python and lightning package than there will be an error with the accelerator = ‘None’.

I installed the vak environment as such:

  • Anaconda Powershell
  • conda create -n vak-env python vak -c pytorch -c conda-forge
  • conda activate vak-env
  • conda install tweetynet -c conda-forge -c pytorch

if you try to execute vak predict and vak train you will get the error that the accelerator shouldn’t be ‘None’.
You have to change that in the files:
1: anaconda3 → vak-env → Lib → site-packages → vak →
in the file: line=60 → change to accelerator = ‘auto’
2: anaconda3 → vak-env → Lib → site-packages → vak → core →
in the file: line=205 → change to accelerator = ‘auto’

As far as I know the ‘None’ doesn’t work with the newest version of lightning package. I chack again which versions i installed. But this solution worked for me :slight_smile:

I hope that helps others!!!

1 Like

Hi @Jacqueline, welcome to the forum and thank you for letting us know about this.
I’m sorry you’re running into this issue.

Thank you also for helping me find the bug.
I think you are right that one way to fix this would be to fallback to 'auto' in line 60 of here:

It sounds like this fix is working for you right now – ideally you wouldn’t need to change code in an installed package though, because that might break other parts of the code that interact with it. It would be better if we fix this bug for you and everybody else and release a new version. (The thought of everybody manually changing code in installed packages and then creating a whole new class of bugs I can’t fix kind of scares me :grimacing: )

Could you please go ahead and raise an issue reporting this bug on the vocalpy/vak issue tracker here?

That way we can be sure to fix it so no one else needs to change code, and we can give you credit for spotting the bug.

You all are training on CPU, right? I think I remember @koparkanya telling me that before. (I saw you had a Tuebi email so I assume you are in Lena’s lab – apologies if I’m mistaken).

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. But we can hash that out on the GitHub issue.

Thank you again, this is really helpful and I appreciate you sharing your solution with others!!! :pray:

Hi @Jacqueline,

Thank you again for catching this bug and suggesting a fix.

Just want to let you know I did raise an issue about it on the vak issue tracker:

If you have a GitHub profile or if you can set one up, please feel free to reply on that issue stating that you’re the one who spotted it, so we can give you credit as a contributor

Hi @nicholdav,

thank you for raising the issue.

1 Like

Sure thing! I know you’re probably busy doing grad student stuff :slight_smile: Thanks again for spotting this

Hi @Jacqueline just letting you know I just released version 1.0.0a2 that includes a temporary fix for this issue. You should be able to pip install vak==1.0.0a2 now to test it. Please do let us know if that fixes things for you if you have a chance.

We plan to replace the device option in the configuration file with accelerator so you can configure this directly and there’s less of an opportunity for this kind of bug to slip in, as discussed here: ENH: Refer to 'accelerator' not 'device' · Issue #691 · vocalpy/vak · GitHub

Thank you again for catching the bug.