ImportError: cannot import name 'WarmupLinearSchedule'

우주먼지·2021년 11월 29일
0

transformers.optimization 중 하나인 warnupLinearSchedule을 사용할 때 발생하는 에러이다.

scheduler = WarmupLinearSchedule(optimizer, warmup_steps=WARMUP_STEPS, t_total = -1)

이처럼 선언하여 사용하는 이를 다음과 같이 바꾸면 에러를 피할 수 있다.

scheduler = get_linear_schedule_with_warmup(optimizer, num_warmup_steps=WARMUP_STEPS, num_training_steps = -1)

warmup_step ⇒ num_warmup_steps

t_total ⇒ num_training_steps

로 파라미터 명을 바꿔줘야 한다. 기능은 같은 것으로 보인다.

https://github.com/huggingface/transformers/issues/2082

profile
안녕하세요 ㅎㅎ

0개의 댓글