OpenGVLab / OpenGVLab/InternVideo

AttributeError: 'BF16_Optimizer' object has no attribute 'cur_scale'

Open
#121 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.4k
Forks
160
PR merge metrics
No merged PRs in 30d

Description

The error occurred when I tried to fine-tune in single_modality

Traceback (most recent call last):
File "run_finetuning.py", line 719, in
main(opts, ds_init)
File "run_finetuning.py", line 636, in main
train_stats = train_one_epoch(
File "/mnt2/xiayingxin/InternVideo/InternVideo2/single_modality/engines/engine_for_finetuning.py", line 92, in train_one_epoch
loss_scale_value = get_loss_scale_for_deepspeed(model)
File "/mnt2/xiayingxin/InternVideo/InternVideo2/single_modality/engines/engine_for_finetuning.py", line 22, in get_loss_scale_for_deepspeed
return optimizer.loss_scale if hasattr(optimizer, "loss_scale") else optimizer.cur_scale
AttributeError: 'BF16_Optimizer' object has no attribute 'cur_scale'

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with single_modality/engines/engine_for_finetuning.py, especially get_loss_scale_for_deepspeed and its call from train_one_epoch. Reproduce the single-modality fine-tuning path through run_finetuning.py and verify that loss-scale retrieval no longer raises the reported BF16_Optimizer AttributeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.