fix: make classification transformers module runnable on modern dependencies and fix evaluation pipeline#207
Open
DhruvrajSinhZala24 wants to merge 1 commit intoML4SCI:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
DeepLense_Classification_Transformers_Archil_Srivastava/module is not runnable on a fresh setup.Running either
train.pyoreval.pyresults in multiple failures due to missing dependencies, outdated APIs, and incorrect evaluation logic. This blocks the full training/evaluation pipeline and makes the module unusable for new contributors.This affects both:
Root Cause
The failures originate from a combination of dependency gaps, API changes, and logic errors:
requirements.txt, causing import errors (wandb,timm,einops,torchmetrics)torchmetricsAPI changes (missing requiredtaskargument)torch.has_mpsno longer validCosineAnnealingWarmRestarts(verbose=...)no longer supportedmicro_auroccomputed asmean([])→ NaNsoftmax(dim=-1)in evaluationSolution
1. Dependency Fix (Reproducibility)
requirements.txt2. torchmetrics Compatibility
torchmetricsAPItaskparameter3. Evaluation Fixes
softmax(dim=-1)4. PyTorch Compatibility
torch.has_mpswith:torch.backends.mps.is_available()torch.backends.mps.is_built()verbose=Truefrom scheduler5. W&B Configuration
--entityargument (defaults to$WANDB_ENTITY)--run_idsupport6. Documentation
README.mdwith setup instructions:pip install -r requirements.txt--entityChanges Made
requirements.txt→ added missing dependencieseval.pysoftmax(dim=-1)train.py--entityutils.pyREADME.mdValidation
python -m compileall -q .
evaluate()test:Impact
Closes #191
Closes #192