Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Floating point exception when running finetuning #33

Open
maximilianmordig opened this issue Aug 31, 2024 · 3 comments
Open

Floating point exception when running finetuning #33

maximilianmordig opened this issue Aug 31, 2024 · 3 comments

Comments

@maximilianmordig
Copy link

maximilianmordig commented Aug 31, 2024

I am getting [1] 1774566 floating point exception python main_finetune.py --batch_size 16 --model vit_large_patch16 --epochs 50 when trying to run your finetuning script. I also slightly changed the code to try out non-distributed mode, but to no avail.
Your dependencies are very outdated, python3.7 is no longer supported, the timm version is 4 years old.
I tried running without the version requirements (so torch>=2, latest timm), but then, I get

# use a separate environment because it requires timm version 0.3.2 for loading the model, otherwise
#  x = global_pool_nlc(x, pool_type=pool_type, num_prefix_tokens=self.num_prefix_tokens)
#   File "/lustre/home/mmordig/micromamba/envs/retfound/lib/python3.10/site-packages/timm/models/vision_transformer.py", line 409, in global_pool_nlc
#     assert not pool_type, f'Unknown pool type {pool_type}'
# AssertionError: Unknown pool type True

timm0.3.2 is not compatible with recent versions of torch (due to importing torch._six).

Do you have a pretrained model that is compatible with more recent torch/timm versions?

@big97kai
Copy link

Same issue. After not using global pool. The result is not very well...

@codevisioner
Copy link

I had the same issue and fixed it by installing the same version of the packages in the requirement.txt.

@tschnake
Copy link

I’m encountering the same issue. This is particularly challenging because I should downgrade my Python version to 3.7.1 to use torch==1.7.1, which supports torch._six, a dependency for timm==0.3.2. At the same time I need Python 3.10 or later for specific functions not supported in earlier Python versions.

It would be highly beneficial if a compatible model could be provided that works with a more recent version of timm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants