【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.
相关推荐
YOLO数据集集合19 分钟前
洪水场景建筑与植被检测数据集 | 洪水检测 建筑识别 植被监测 灾情评估 目标检测9073期
人工智能·目标检测·机器学习·计算机视觉·目标跟踪·无人机视角·灾害救援
Q264336502334 分钟前
【有源码】基于机器学习的电信网络诈骗话术语义识别与可视化分析系统 XGBoost算法+Hadoop+Spark
大数据·hadoop·算法·机器学习·spark·毕业设计·课程设计
不会就选b44 分钟前
算法日常・每日刷题--贪心<11>
算法·leetcode·职场和发展
千里码aicood1 小时前
面向电商冷启动与数据稀疏性的协同过滤算法优化研究
大数据·算法·协同过滤
Rocky Ding*1 小时前
【三年面试五年模拟】2026-09-08 DeepSeek AI Agent开发岗社招一面:20道问题与系统设计题全解析
论文阅读·人工智能·深度学习·机器学习·aigc·ai-native·deepseek
xxxiugou1231 小时前
双指针解题秘籍:从入门到精通
c语言·数据结构·c++·算法
能源革命1 小时前
TimesFM(Time Series Foundation Model)介绍
算法·能源
猎嘤一号1 小时前
学术训练(一)文献检索与阅读
人工智能·算法·机器学习·科研入门
AI让世界更懂你1 小时前
计算机专业研究生核心能力培养(5)——论文写作的结构与方法
人工智能·深度学习·机器学习