Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[General Issue]为什么加载预训练权重后反而效果不好? #81

Closed
yiiizuo opened this issue Dec 17, 2022 · 5 comments
Closed
Assignees
Labels
question Further information is requested stale old issue/PR without interaction for a long time

Comments

@yiiizuo
Copy link

yiiizuo commented Dec 17, 2022

欢迎您的提问。辛苦您提供以下信息,以方便我们快速定位和解决问题:

  1. PaddleRS版本:(请提供版本号和分支信息,如PaddleRS release/1.0)
    develop branch
  2. PaddlePaddle版本:(如PaddlePaddle 2.3.0)
    paddle2.4.1.post17
  3. 操作系统信息:(如Linux/Windows/MacOS)
    ubuntu20.04
  4. Python版本号:(如Python3.7/8)
    python3.9
  5. CUDA/cuDNN版本:( 如CUDA10.2/cuDNN 7.6.5等)
    cuda11.7,cudnn8.4.0,nccl2.14.3
  6. 其他内容: (增加其他与问题相关的内容)

我测试了关于bit、cdnet两个网络在Levir数据集上的表现,同时训练100epoch,当我没有加载pretrain_weights时:
bit的test结果为'iou':0.75169,'f1':0.85246,'oacc':0.98627,'kappa':0.85105,
cdnet的test结果为'iou':0.66071,'f1':0.79570,'oacc':0.97966,'kappa':0.78500。
而当我在run_task.py的model.tain()中加入,pretrain_weights='BIT_LEVIRCD'或者pretrain_weights='cdnet_LEVIRCD'后,100个epoch的结果反而为:
bit:'iou':0.68747,'f1':0.81480,'oacc':0.98233,'kappa':0.80557,
cdnet:'iou':0.50427,'f1':0.67045,'oacc':0.97045,'kappa':0.65529。
我不能理解为什么在加载预训练权重后,精度反而下降了很多?
两者的差距仅仅只是我在model.train中添加了pretrain_weights参数,如下:

9ad7c8054944d5158db2c4d0589a7a6

我添加预训练的日志文件为:
trainlog.log

@yiiizuo yiiizuo added the question Further information is requested label Dec 17, 2022
@github-actions github-actions bot added the triage new issue/PR waiting to be dealed label Dec 17, 2022
@Bobholamovic Bobholamovic self-assigned this Dec 17, 2022
@github-actions github-actions bot removed the triage new issue/PR waiting to be dealed label Dec 17, 2022
@Bobholamovic
Copy link
Member

你好,我检查了一下,云端的 BIT_LEVIRCD 权重好像出了些问题,有可能是文件损坏导致的。我已经更新了该权重文件,建议你手动删除/media/zy/extraDisk/exps/BIT/levircd/pretrain/bit_levircd.pdparams这个文件,然后重新执行加载预训练权重的训练试试。

另外,指定预训练权重只需要pretrain_weights='LEVIRCD'就行哈,不用加上模型名作为前缀,这样在更换模型的时候会比较方便一些,不需要同步修改多处代码。

@yiiizuo
Copy link
Author

yiiizuo commented Dec 17, 2022

你好,我检查了一下,云端的 BIT_LEVIRCD 权重好像出了些问题,有可能是文件损坏导致的。我已经更新了该权重文件,建议你手动删除/media/zy/extraDisk/exps/BIT/levircd/pretrain/bit_levircd.pdparams这个文件,然后重新执行加载预训练权重的训练试试。

另外,指定预训练权重只需要pretrain_weights='LEVIRCD'就行哈,不用加上模型名作为前缀,这样在更换模型的时候会比较方便一些,不需要同步修改多处代码。

好的好的,谢谢您的回复,我待会就去试试。按理说,这样的预训练权重是不是不用fine-tune,也能跑到很高的分数?

@yiiizuo
Copy link
Author

yiiizuo commented Dec 17, 2022

你好,我检查了一下,云端的 BIT_LEVIRCD 权重好像出了些问题,有可能是文件损坏导致的。我已经更新了该权重文件,建议你手动删除/media/zy/extraDisk/exps/BIT/levircd/pretrain/bit_levircd.pdparams这个文件,然后重新执行加载预训练权重的训练试试。

另外,指定预训练权重只需要pretrain_weights='LEVIRCD'就行哈,不用加上模型名作为前缀,这样在更换模型的时候会比较方便一些,不需要同步修改多处代码。

您好,我刚重新尝试了,但是下载预训练权重出现了404错误
屏幕截图_20221217_134443

@Bobholamovic
Copy link
Member

你好,我检查了一下,云端的 BIT_LEVIRCD 权重好像出了些问题,有可能是文件损坏导致的。我已经更新了该权重文件,建议你手动删除/media/zy/extraDisk/exps/BIT/levircd/pretrain/bit_levircd.pdparams这个文件,然后重新执行加载预训练权重的训练试试。
另外,指定预训练权重只需要pretrain_weights='LEVIRCD'就行哈,不用加上模型名作为前缀,这样在更换模型的时候会比较方便一些,不需要同步修改多处代码。

您好,我刚重新尝试了,但是下载预训练权重出现了404错误 屏幕截图_20221217_134443

应该是上一周维护的时候误删除了。我已经修复此问题,请再次尝试。

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale old issue/PR without interaction for a long time label Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested stale old issue/PR without interaction for a long time
Projects
None yet
Development

No branches or pull requests

2 participants