A debugger for PyTorch transfer-learning & fine-tuning jobs
Project description
PyTorch Transfer Learning Debugger
Getting Started
pip install the package:
pip install torch-transfer-learning-debugger
or
pip install git+<URL>
Then, run the debugger by incorporating it in your training loop.
Potential Faults during Transfer Learning
| Category | Failure Points | Common Solutions |
|---|---|---|
| Learning Rate | • Too high: unstable training • Too low: slow learning/stuck • Improper adjustment for transfer learning |
• Start with 10-3 or 10-4 of original LR • Use LR finder • Implement LR scheduling |
| Layer Freezing | • Wrong layers frozen • Too many/few layers frozen • No gradual unfreezing |
• Start by freezing all but final layers • Gradually unfreeze from top • Monitor layer gradients |
| Data Issues | • Insufficient data • Poor quality/preprocessing • Domain shift • Class imbalance • Wrong normalization |
• Data augmentation • Match source preprocessing • Balance classes • Use validation set |
| Architecture | • Bad final layer modifications • Size/channel mismatches • Poor layer initialization • Wrong output dimensions |
• Verify input/output dimensions • Use proper initialization • Match pretrained architecture |
| Optimization | • Wrong optimizer choice • Incorrect loss function • Bad batch size • Poor momentum settings |
• Use Adam/AdamW for fine-tuning • Verify loss matches task • Start with small batches |
| Implementation | • Model not in train mode • Gradients not zeroed • Wrong device (CPU/GPU) • Memory leaks |
• Use training checklist • Implement proper train/eval • Check device placement • Monitor memory usage |
| Pretrained Model | • Wrong pretrained weights • Corrupted weights • Version incompatibility |
• Verify model source • Check model checksums • Match framework versions |
| Monitoring | • Poor metric tracking • No early stopping • Missing validation • No gradient monitoring |
• Use debugging tools • Implement validation loops • Track multiple metrics • Monitor gradient flow |
For Developers: Fork
A debugger for running PyTorch transfer-learning & fine-tuning jobs.
: zachcolinwolpe@gmail.com
: 06.12.2024
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytorch_transfer_learning_debugger-0.1.0.tar.gz.
File metadata
- Download URL: pytorch_transfer_learning_debugger-0.1.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8ab41bc0d1d7e301931d98d454cbf23f6b7249b279e5e318c4dc1d22397cb01
|
|
| MD5 |
b24034b20a32e1fb6e2f2a1ab7fd3f3d
|
|
| BLAKE2b-256 |
068d589a4ac1c2558fa50f572e19534208ef696310da9dec6b493de9c6da1b72
|
Provenance
The following attestation bundles were made for pytorch_transfer_learning_debugger-0.1.0.tar.gz:
Publisher:
workflow.yml on ZachWolpe/PyTorch-transfer-learning-debugger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytorch_transfer_learning_debugger-0.1.0.tar.gz -
Subject digest:
f8ab41bc0d1d7e301931d98d454cbf23f6b7249b279e5e318c4dc1d22397cb01 - Sigstore transparency entry: 153953844
- Sigstore integration time:
-
Permalink:
ZachWolpe/PyTorch-transfer-learning-debugger@1b48fc6aa2a11f70c9eb0dc8a564b7015fadc38b -
Branch / Tag:
refs/tags/v0.1.0.0 - Owner: https://github.com/ZachWolpe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@1b48fc6aa2a11f70c9eb0dc8a564b7015fadc38b -
Trigger Event:
release
-
Statement type:
File details
Details for the file pytorch_transfer_learning_debugger-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pytorch_transfer_learning_debugger-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98c7689d5303df0b2f4fe85f9ea4b3f8fe887e2f4310453694f11905aa48aec2
|
|
| MD5 |
a4d3ea48ca13ffad6bf9875355835af3
|
|
| BLAKE2b-256 |
6668722cfe19360b96bf9228402e16ef12298f73d1867dd2cd1fe17b0d2a549e
|
Provenance
The following attestation bundles were made for pytorch_transfer_learning_debugger-0.1.0-py3-none-any.whl:
Publisher:
workflow.yml on ZachWolpe/PyTorch-transfer-learning-debugger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytorch_transfer_learning_debugger-0.1.0-py3-none-any.whl -
Subject digest:
98c7689d5303df0b2f4fe85f9ea4b3f8fe887e2f4310453694f11905aa48aec2 - Sigstore transparency entry: 153953845
- Sigstore integration time:
-
Permalink:
ZachWolpe/PyTorch-transfer-learning-debugger@1b48fc6aa2a11f70c9eb0dc8a564b7015fadc38b -
Branch / Tag:
refs/tags/v0.1.0.0 - Owner: https://github.com/ZachWolpe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@1b48fc6aa2a11f70c9eb0dc8a564b7015fadc38b -
Trigger Event:
release
-
Statement type: