Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions PyTorch/build-in/Classification/SigLIP2/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
```markdown
## 1. 模型链接
- 原始仓库链接:
https://github.com/huggingface/pytorch-image-models?tab=readme-ov-file#models

## 2. 快速开始

使用本模型执行训练的主要流程如下:

1. **基础环境安装**:介绍训练前需要完成的基础环境检查和安装。
2. **获取数据集**:介绍如何获取训练所需的数据集。
3. **构建环境**:介绍如何构建模型运行所需要的环境。
4. **启动训练**:介绍如何运行训练。

### 2.1 基础环境安装

请参考主仓库的基础环境安装章节,完成训练前的基础环境检查和安装(如驱动、固件等)。

### 2.2 准备数据集

#### 2.2.1 获取数据集

训练使用 **CIFAR-100** 数据集。该数据集为开源数据集,包含 100 个类别的 60000 张彩色图像。

#### 2.2.2 处理数据集

请确保数据集已下载并解压。根据训练脚本的默认配置,建议将数据集存放在模型目录的上级 `data` 目录中(即 `../data`),或者根据实际路径修改训练命令中的 `--datapath` 参数。

### 2.3 构建环境

所使用的环境下需包含 PyTorch 框架虚拟环境。

1. 执行以下命令,启动虚拟环境(根据实际环境名称修改):

```bash
conda activate torch_env_py310

```

2. 安装 Python 依赖。确保已安装项目所需的依赖包:
```bash
pip install -r requirements_exact.txt

```



### 2.4 启动训练

1. 在构建好的环境中,进入模型训练脚本所在目录。

2. 运行训练。该模型支持单机单卡训练。
执行以下命令启动训练(使用 CIFAR-100 数据集,Batch Size 为 128):
```bash
python weloTrainStep.py \
--name train \
--arch siglip2 \
--print_freq 1 \
--steps 100 \
--dataset cifar100 \
--datapath ../data \
--batch_size 32 \
--epochs 100

```
89 changes: 89 additions & 0 deletions PyTorch/build-in/Classification/SigLIP2/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
addict==2.4.0
aliyun-python-sdk-core==2.16.0
aliyun-python-sdk-kms==2.16.5
anyio==4.11.0
astunparse==1.6.3
certifi==2024.12.14
cffi==2.0.0
charset-normalizer==3.4.1
click==8.3.1
colorama==0.4.6
contourpy==1.3.2
crcmod==1.7
cryptography==46.0.3
cycler==0.12.1
einops==0.8.1
exceptiongroup==1.3.1
filelock==3.14.0
fonttools==4.60.1
fsspec==2024.12.0
future @ file:///croot/future_1730902796226/work
git-filter-repo==2.47.0
h11==0.16.0
hf-xet==1.2.0
httpcore==1.0.9
httpx==0.28.1
huggingface_hub==1.1.5
idna==3.10
inplace-abn @ git+https://github.com/mapillary/inplace_abn.git@b50bfe9c7cd7116a3ab091a352b48d6ba5ee701c
Jinja2==3.1.5
jmespath==0.10.0
joblib==1.5.2
kiwisolver==1.4.9
Markdown==3.10
markdown-it-py==4.0.0
MarkupSafe==3.0.2
matplotlib==3.10.7
mdurl==0.1.2
mmdet==3.3.0
mmengine==0.10.7
model-index==0.1.11
mpmath==1.3.0
networkx==3.4.2
numpy==1.23.5
opencv-python==4.12.0.88
opendatalab==0.0.10
openmim==0.3.9
openxlab==0.1.3
ordered-set==4.1.0
oss2==2.17.0
packaging @ file:///croot/packaging_1734472117206/work
pandas==2.3.3
pillow==11.1.0
platformdirs==4.5.1
pycocotools==2.0.11
pycparser @ file:///tmp/build/80754af9/pycparser_1636541352034/work
pycryptodome==3.23.0
Pygments==2.19.2
pyparsing==3.2.5
python-dateutil==2.9.0.post0
pytz==2023.4
PyYAML @ file:///croot/pyyaml_1728657952215/work
requests==2.28.2
rich==13.4.2
safetensors==0.7.0
scikit-learn==1.7.2
scipy==1.15.3
shapely==2.1.2
shellingham==1.5.4
six @ file:///tmp/build/80754af9/six_1644875935023/work
sniffio==1.3.1
sympy==1.13.3
tabulate==0.9.0
termcolor==3.2.0
terminaltables==3.1.10
threadpoolctl==3.6.0
timm==1.0.22
tomli==2.3.0
torch @ file:///apps/torch-2.4.0a0%2Bgit4451b0e-cp310-cp310-linux_x86_64.whl#sha256=2e472c916044cac5a1a0e0d8b0e12bb943d8522b24ff826c8014dd444dccd378
torch_sdaa @ file:///apps/torch_sdaa-2.0.0-cp310-cp310-linux_x86_64.whl#sha256=5aa57889b002e1231fbf806642e1353bfa016297bc25178396e89adc2b1f92e7
torchaudio @ file:///apps/torchaudio-2.0.2%2Bda3eb8d-cp310-cp310-linux_x86_64.whl#sha256=46525c02fb7eaa8dafea860428de3d01e437ba8d6ff2cc228d7c71975ac4054b
torchdata @ file:///apps/torchdata-0.6.1%2Be1feeb2-py3-none-any.whl#sha256=aa2dc1a7732ea68adfad186978049bf68cc1afdbbdd1e17a8024227ab770e433
torchtext @ file:///apps/torchtext-0.15.2a0%2B4571036-cp310-cp310-linux_x86_64.whl#sha256=7e42c684ba366f97b59ec37488bf95e416cce3892b6589200d2b3ad159ee5788
torchvision @ file:///apps/torchvision-0.15.1a0%2B42759b1-cp310-cp310-linux_x86_64.whl#sha256=4b904db2d50102415536bc764bbc31c669b90b1b014f90964e9eccaadb2fd9eb
tqdm==4.65.2
typer-slim==0.20.0
typing_extensions==4.15.0
tzdata==2025.2
urllib3==1.26.20
yapf==0.43.0
Loading