pytorch-lr-finder icon indicating copy to clipboard operation
pytorch-lr-finder copied to clipboard

ValueError ValDataLoaderIter next() call missing

Open paulhager opened this issue 4 years ago • 1 comments
trafficstars

In the _validate function, you try to iterate through the elements of ValDataLoaderIter with a simple for loop:

https://github.com/davidtvs/pytorch-lr-finder/blob/acc5e7ee7711a460bf3e1cc5c5f05575ba1e1b4b/torch_lr_finder/lr_finder.py#L427

This throws a 'ValueError: too many values to unpack' because it is attempting to unpack the entire dataloader which has way more then two elements. I think what you want here is just the next element in val_iter, similarly to your _train_batch function, so a loop over the length of val_iter with a call to next(val_iter) every loop or an enumerate(val_iter), no?

paulhager avatar Jul 22 '21 15:07 paulhager

Hi @paulhager! Is the situation mentioned in this issue similar to the one you ran into? https://github.com/davidtvs/pytorch-lr-finder/issues/61#issuecomment-692715109

If not, can you describe more about it?

NaleRaphael avatar Jul 23 '21 11:07 NaleRaphael

Closing due to inactivity

davidtvs avatar Feb 03 '24 10:02 davidtvs