8000 lm_loss类型是str,无法计算loss · Issue #110 · thu-coai/CDial-GPT · GitHub
[go: up one dir, main page]

Skip to content

lm_loss类型是str,无法计算loss #110

Open

Description

@ziqing0701

您好,我在运行train()时报错 TypeError: unsupported operand type(s) for /: 'str' and 'int'
(lm_loss), *_ = model(input_ids, labels=lm_labels, token_type_ids=token_type_ids)
loss = lm_loss / args.gradient_accumulation_steps

debug发现lm_loss 是str类型,请问是哪里出错了。
用的预训练thu-coai/CDial-GPT_LCCC-base模型,"--data_path"是"data/STC.json"

谢谢!

Activity

  1. YuChuXi commented on May 13, 2023

    @YuChuXi

    把model(...)换成model.forward(...)试试

  2. ziqing0701 commented on May 13, 2023

    @ziqing0701
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0