Fine-tune a pretrained ResNet18 on the Beans dataset from HuggingFace.
load_data— Downloads the Beans dataset (3 classes, ~1000 images), applies ImageNet transforms, saves as tensorstrain— Fine-tunes ResNet18 with a replaced classification head, trains with Adam + CrossEntropyLosspipeline— Orchestrates load data -> train
cd tutorials/starter-examples/image-classifier
uv venv .venv --python 3.11
source .venv/bin/activate
uv pip install -r requirements.txtTo run remotely, configure your Flyte cluster endpoint:
flyte create config \
--endpoint <your-endpoint> \
--auth-type headless \
--builder remote \
--domain development \
--project flytesnacksDon't have a cluster? Request access at flyte.org.
Remote:
uv run flyte run image_classifier.py pipeline --num_epochs 3Local:
uv run flyte run --local image_classifier.py pipeline --num_epochs 3