8c279ccf47 | ||
---|---|---|
.. | ||
configs | ||
README.md | ||
metric.py | ||
requirements.txt | ||
run_image_classification.py |
README.md
Use OpenDelta in vision transformer ViT
This example uses the huggingface image classification examples, by adding several lines in the original scripts.
Usage
1. install necessary package
pip install Pillow
pip install torchvision
pip install transformers==4.16.2
pip install datsets==1.18.0
2. run
python run_image_classification.py configs/lora_beans.json
Do not forget to re-install datasets back into 1.17.0 for other examples. :)
Possible Errors
- dataset connection error
Solution 1: open a python console, running the error command again, may not be useful
Solution 2: download the dataset by yourself on a internect connected machine, saved to disk and transfer to your server, at last load_from_disk.
Link to original training scripts
You may find solution to other question about the scripts and irrelevant to Opendelta in https://github.com/huggingface/transformers/tree/master/examples/pytorch/image-classification