Infinite recursion when calling self.log(...)
in validation loop with dataset that returns string in item dict
#3906
Labels
self.log(...)
in validation loop with dataset that returns string in item dict
#3906
🐛 Bug
I'm not sure if this is a behavior that was intended to be supported in the first place, but PR #3888 introduced a regression on passing strings as part of the data in a batch. Now, if we pass a dictionary where one of the values is a string,
Result.unpack_batch_size
falls into an infinite recursion loop when trying to log anything during the validation step.To Reproduce
See PR #3907 for a test that reproduces the bug on the current master. The test becomes functional when commenting out line 22 (the call to
self.log(...)
in the validation loop).The recursion happens in this specific statement in
unpack_batch_size()
:which recurses infinitely when sample is a string.
The full stacktrace I get when running the test is the following:
Code sample
See See PR #3907.
Expected behavior
We should be able to use strings in the data returned by the dataset, and still be able to call
self.log(...)
in the validation loop.Environment
- GPU: TITAN Xp
- available: True
- version: 10.2
- numpy: 1.19.2
- pyTorch_debug: False
- pyTorch_version: 1.6.0
- pytorch-lightning: 0.9.1rc4
- tqdm: 4.49.0
- OS: Linux
- architecture: 64bit, ELF
- processor: x86_64
- python: 3.8.5
- version: Typo: says seq-2seq in README #51~18.04.1-Ubuntu SMP Sat Sep 5 14:35:50 UTC 2020
Edit: Added reference to draft PR
The text was updated successfully, but these errors were encountered: