question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RecursionError: maximum recursion depth exceeded in comparison encountered while finetuning

See original GitHub issue

❓ Questions and Help

Before asking:

  1. search the issues.
  2. 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
ethanwharriscommented, Jun 28, 2021

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 😃

0reactions
ethanwharriscommented, Jul 1, 2021

PyTorch Lightning 1.3.8 is out so this should now be resolved 😃 Feel free to re-open if not

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found