微调报错解决-ValueError: invalid literal for int() with base 10: ‘.ipynb_checkpoints’

内容纲要

报错日志

You are using an old version of the checkpointing format that is deprecated (We will also silently ignore `gradient_checkpointing_kwargs` in case you passed it).Please update to the new format on your modeling file. To use the new format, you need to completely remove the definition of the method `_set_gradient_checkpointing` in your model.
/root/miniconda3/lib/python3.10/site-packages/accelerate/accelerator.py:432: FutureWarning: Passing the following arguments to `Accelerator` is deprecated and will be removed in version 1.0 of Accelerate: dict_keys(['dispatch_batches', 'split_batches', 'even_batches', 'use_seedable_sampler']). Please pass an `accelerate.DataLoaderConfiguration` instead: 
dataloader_config = DataLoaderConfiguration(dispatch_batches=None, split_batches=False, even_batches=True, use_seedable_sampler=True)
  warnings.warn(
max_steps is given, it will override any value given in num_train_epochs
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /root/finetune_hf.py:540 in main                                             │
│                                                                              │
│   537 │   │   checkpoint_sn = 0                                              │
│   538 │   │   for checkpoint_str in dirlist:                                 │
│   539 │   │   │   if checkpoint_str.find("eckpoint") > 0 and checkpoint_str. │
│ ❱ 540 │   │   │   │   checkpoint = int(checkpoint_str.replace("checkpoint-", │
│   541 │   │   │   │   if checkpoint > checkpoint_sn:                         │
│   542 │   │   │   │   │   checkpoint_sn = checkpoint                         │
│   543 │   │   if auto_resume_from_checkpoint.upper() == "YES":               │
╰──────────────────────────────────────────────────────────────────────────────╯
ValueError: invalid literal for int() with base 10: '.ipynb_checkpoints'

主要报错

ValueError: invalid literal for int() with base 10: '.ipynb_checkpoints'

原因

在第一次微调的基础上继续微调,碰到了一个名为.ipynb_checkpoints的目录(这是Jupyter Notebook自动创建的隐藏目录,用于存放自动保存的笔记本版本)。

解决方案

删除checkpoint输出的output目录内的.ipynb_checkpoints的目录

Leave a Comment

您的电子邮箱地址不会被公开。 必填项已用*标注

close
arrow_upward