Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Binary pretrained model can't train a multi-class classifier?

未关闭
#172 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python, pytorch

调研方向

从 GraphormerForGraphClassification.from_pretrained 调用和 graphml-classification.md 示例开始,然后使用 clefourrier/graphormer-base-pcqm4mv2 checkpoint 和 168 个类别复现 Python 脚本。检查需要处理的问题是 classifier-size warning 还是停滞的训练进度;当多类别训练运行能够继续,或失败原因得到清楚解释时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

I use model_checkpoint = "clefourrier/graphormer-base-pcqm4mv2" # pre-trained model from which to fine-tune to be my pretrained model, and my dataset is here.
I follow the code in this website.
But change the

model = GraphormerForGraphClassification.from_pretrained(
    model_checkpoint, 

    # We have 167 attack patterns and 1 benign
    num_classes=168, 

    # provide this in case you're planning to fine-tune an already fine-tuned checkpoint
    ignore_mismatched_sizes = True, 

Since I have 168 class to be classified.
Then when I run the python script, I encountered:

Some weights of GraphormerForGraphClassification were not initialized from the model checkpoint at clefourrier/graphormer-base-pcqm4mv2 and are newly initialized because the shapes did not match:
- classifier.classifier.weight: found shape torch.Size([1, 768]) in the checkpoint and torch.Size([168, 768]) in the model instantiated
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
  0%|                                                                                                                                                                                                                                          | 0/23120 [00:00<?, ?it/s]

For about 20 min, the log didn't move at all.

主要语言
Python
星标
2.5k
派生
374
PR 合并指标
30 天内没有已合并 PR

环境准备

我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/Graphormer 的其他 Issue

查看 microsoft/Graphormer 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。