LINCellularNeuroscience/VAME

Evaluate model error: "AttributeError: '_SingleProcessDataLoaderIter' object has no attribute 'next'"

weberisla opened this issue · 7 comments

Screen Shot 2023-02-14 at 1 30 29 AM

Running up against this error when trying to evaluate my model in Google Colab. I'm not sure what the issue is here, would appreciate pointers.

Possibly unrelated, but my current version of torch is 1.13.1, whereas I think I saw somewhere that 1.5.0 may be required?

Hi there,

exactly, that method calls a function that is related to the PyTorch Dataloader and imported via torch.utils.data. Please try upgrading to PyTorch 1.5, we developed VAME with that version.

Best,
Pavol

Hi Pavol,

Thanks for confirming this! I've upgraded PyTorch but now am having issues with model training-- it gets stuck at the point pictured below indefinitely, and I am also unable to stop the code chunk from running. Is this possibly due to the errors listed after upgrading? Let me know if you have a suggestion here, and apologies if there is an easy fix I am unaware of!

Screen Shot 2023-02-23 at 1 55 29 PM

Screen Shot 2023-02-23 at 1 55 39 PM

I ran into a similar issue with PyTorch today. I tried to downgrade to PyTorch 1.5 but google colab is not letting me downgrade to anything lower than PyTorch 1.7.1.

Thanks for letting us know, we will evaluate if VAME works with the newest PyTorch version.

Thanks for letting us know, we will evaluate if VAME works with the newest PyTorch version.

I managed to get the evaluation to work with PyTorch 2.0 by editing the evaluate.py file. In line 32, I changed:

x = test_loader.iter().next() and added '__' before and after next followed by the brackets

Then, it worked. So, hopefully that can resolve it for anyone else with the same issue.

We encountered the same error and had a similar solution to @G-Hepburn but changed Line 32 of evaluate.py to:

x = next(test_loader.iter())

This seems to have fixed the issue as well.

Happy to announce that this fix is now included in the new commits in the master branch.
BR
Pavol