OpenDeltaMirror/examples/examples_image-classification
DingDing 8c279ccf47
Update README.md
2022-02-14 23:28:40 +08:00
..
configs first commit 2022-02-14 21:19:03 +08:00
README.md Update README.md 2022-02-14 23:28:40 +08:00
metric.py first commit 2022-02-14 21:19:03 +08:00
requirements.txt first commit 2022-02-14 21:19:03 +08:00
run_image_classification.py first commit 2022-02-14 21:19:03 +08:00

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

  1. 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.

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