【Qwen】DataArguments说明

DataArguments

Holds all configuration options for data loading and preprocessing in Qwen-VL fine-tuning. Passed as data_args after parsing from the command line (e.g. via HfArgumentParser) and used by make_supervised_data_module to build the dataset and collator.


Attributes

Name Type Default Description
dataset_use str "" Comma-separated dataset names or paths. Resolved via data_list() to get annotation_path and data_path for LazySupervisedDataset.
data_flatten bool False If True, use FlattenedDataCollatorForSupervisedDataset and packed sequences; otherwise use DataCollatorForSupervisedDataset.
data_packing bool False If True, enable sequence packing in the dataset (_get_packed_item).
base_interval int 2 Base interval used in packing or flattening (exact meaning depends on data_list / collator implementation).
max_pixels int 28 * 28 * 576 Maximum number of pixels (e.g. H * W) for an image. Written to the image processor's size["longest_edge"] / max_pixels.
min_pixels int 28 * 28 * 16 Minimum number of pixels for an image. Written to the image processor's size["shortest_edge"] / min_pixels.
video_max_frames int or None 8 Maximum number of sampled frames per video (used by video processor if present).
video_min_frames int or None 4 Minimum number of sampled frames per video.
video_max_pixels int 1024 * 28 * 28 Maximum total pixels for video frames. Set on the video processor when available.
video_min_pixels int 256 * 28 * 28 Minimum total pixels for video frames.
video_fps float 2 Frames per second used when sampling video.

Usage

Parsed together with ModelArguments and TrainingArguments in the training script:

python 复制代码
parser = transformers.HfArgumentParser(
    (ModelArguments, DataArguments, TrainingArguments)
)
model_args, data_args, training_args = parser.parse_args_into_dataclasses()

data_module = make_supervised_data_module(processor, data_args=data_args)

Command-line example:

bash 复制代码
python qwenvl/train/train_qwen.py \
    --dataset_use "path/to/annotations.json" \
    --data_flatten True \
    --max_pixels 50176 \
    --min_pixels 784

Note

  • DataArguments is defined in qwenvl/train/argument.py and is a dataclass. The parsed instance is typically named data_args in the training pipeline.
  • The image processor's pixel limits are updated in update_processor_pixels(processor, data_args) using max_pixels and min_pixels.
相关推荐
kishu_iOS&AI几秒前
机器学习 —— 逻辑回归(混淆矩阵)
人工智能·算法·机器学习·逻辑回归
QQ67658008几秒前
基于cnn的YOLOV8算法 智慧城市环境治理之河道垃圾检测 地面垃圾落地识别 碎料垃圾检测 深度学习第10422期
深度学习·yolo·cnn·环境治理·河道垃圾检测·地面垃圾落地识别·碎料垃圾检测
AI视觉网奇2 分钟前
copilot-api 部署笔记
人工智能·深度学习
W23035765734 分钟前
经典算法:打家劫舍(动态规划 + 回溯求最优解)C++ 超详细解析
c++·算法·动态规划
Dev7z5 分钟前
基于改进小波阈值的sEMG信号降噪与手势识别系统设计与实现
算法·手势识别·改进小波阈值·semg·信号降噪
灵感__idea7 小时前
Hello 算法:贪心的世界
前端·javascript·算法
逻辑君8 小时前
认知神经科学研究报告【20260010】
人工智能·深度学习·神经网络·机器学习
澈2079 小时前
深入浅出C++滑动窗口算法:原理、实现与实战应用详解
数据结构·c++·算法
ambition202429 小时前
从暴力搜索到理论最优:一道任务调度问题的完整算法演进历程
c语言·数据结构·c++·算法·贪心算法·深度优先
cmpxr_9 小时前
【C】原码和补码以及环形坐标取模算法
c语言·开发语言·算法