RecursionError: maximum recursion depth exceeded in comparison encountered while finetuning
See original GitHub issue❓ Questions and Help
Before asking:
- search the issues.
- search the docs.
What is your question?
Question 1 : As a part of Lightning-Flash , do you have provision to prepare datamodules from dataframe
Code
Like we have the from_folders
datamodule = ImageClassificationData.from_folders(
train_folder="data/hymenoptera_data/train/",
val_folder="data/hymenoptera_data/val/",
test_folder="data/hymenoptera_data/test/",
)
Question 1 : Do we have ImageClassificationData.from_dataframe() ?
Question 2 : Encounter RecursionError: while performing finetuning
# 2. Load the data
datamodule = ImageClassificationData.from_folders(
train_folder="/content/drive/MyDrive/dphi/Kvasir/The Kvasir-Capsule/TRAIN/",
val_folder="/content/drive/MyDrive/dphi/Kvasir/The Kvasir-Capsule/VAL/",
predict_folder="/content/drive/MyDrive/dphi/Kvasir/The Kvasir-Capsule/test/",
)
# 3 Build the model
model = ImageClassifier(backbone="densenet121", num_classes=datamodule.num_classes)
# 4. Train the model
trainer.finetune(model, datamodule=datamodule, strategy=FreezeUnfreeze(unfreeze_epoch=1))
Error Encountered:-
RecursionError: maximum recursion depth exceeded in comparison
What have you tried?
What’s your environment?
Lightning-flash version :0.4.1dev Lightning version : 1.3.7post0 Coding in Google Colab
- OS: [e.g. iOS, Linux, Win]
- Packaging [e.g. pip, conda]
- Version [e.g. 0.5.2.1]
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
What is the maximum recursion depth in Python, and how to ...
RecursionError : maximum recursion depth exceeded in comparison. Solution : First it's better to know when you execute a recursive ...
Read more >RecursionError: maximum recursion depth exceeded ... - GitHub
Question 2 : Encounter RecursionError: while performing finetuning. # 2. Load the data datamodule = ImageClassificationData.from_folders( ...
Read more >Python maximum recursion depth exceeded in comparison
The Solution. Python has raised a recursion error to protect us against a stack overflow. This is when the pointer in a stack...
Read more >Python: Maximum Recursion Depth Exceeded [How to Fix It]
This error says it all—maximum recursion depth exceeded in comparison. This tells you that Python's recursion depth limit of 1000 is reached.
Read more >Generate method during finetuning - Hugging Face Forums
I ran this code and it looks like I'm getting a recursion error: ... RecursionError: maximum recursion depth exceeded while calling a Python ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi @plaban1981 This turned out to be an issue in lightning. The PR PyTorchLightning/lightning-flash#8170 has been merged now so your issue should be fixed when lightning 1.3.8 is released (should be tomorrow). Hope that helps 😃
PyTorch Lightning 1.3.8 is out so this should now be resolved 😃 Feel free to re-open if not