Skip to content

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

@ziqing0701

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"

谢谢!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions