Issues | Baseline MISF-CVPR2022 Reprod & GIQA improve

关于loss参数

1
[('epoch', 1), ('iter', 1), ('l_d2', 0.707538366317749), ('l_g2', 0.07427514344453812), ('l_l1', 0.7772688865661621), ('l_per', 0.20167401432991028), ('l_sty', 0.393798291683197)]
1
2
3
4
5
6
7
logs = [
("l_d2", dis_loss.item()),
("l_g2", gen_gan_loss.item()),
("l_l1", gen_l1_loss.item()),
("l_per", gen_content_loss.item()),
("l_sty", gen_style_loss.item()),
]

其中,l_d2是Inpainting Model的Discriminator loss,l_g2是Inpainting Model的Generator loss,l_l1是L1 loss,l_per是Perceptual loss,l_sty是Style loss。

这篇文章作者的code是基于Edge Connect的代码Repo的,原模型Edge Connect分为了Edge model、Inpainting Model、Inpaint with Edge Model以及Joint Model四个训练阶段,这里MISF的作者应该是只用了Inainting Model的部分并进行了修改。

wandb使用

1
2
3
4
5
6
7
8
9
10
11
12
import wandb  # 使wandb库在pytorch库之后引用

default_config = dict(
batch_size=128,
dropout=0.5
)

wandb.init(project="pj-name", config=default_config, mode="online/offline/disabled")

batch_size = wandb.config.batch_size # 保证代码可读性和一致性

wandb.log({'epoch': epoch, 'loss': loss, 'accuracy': accuracy})

Package import

sys.path指定模块搜索路径的列表。默认情况下,python导入文件或者模块,会在sys.path里找模块的路径。如果路径下搜索不到模块的话,就会报错。

1
2
3
import sys
print(sys.path)
sys.path.append('/home/nsy/nlp') # package路径为/home/nsy/nlp/new_package
1
['/home/user5/code/misf-main', '/home/user5/.pycharm_helpers/pydev', '/home/user5/code/misf-main', '/home/user5/.pycharm_helpers/pycharm_display', '/home/user5/.pycharm_helpers/third_party/thriftpy', '/home/user5/.pycharm_helpers/pydev', '/home/user5/code/misf-main/C', '/Users/75796/AppData/Local/JetBrains/PyCharm2021.3/cythonExtensions', '/home/user5/anaconda3/envs/testenv/lib/python38.zip', '/home/user5/anaconda3/envs/testenv/lib/python3.8', '/home/user5/anaconda3/envs/testenv/lib/python3.8/lib-dynload', '/home/user5/.local/lib/python3.8/site-packages', '/home/user5/code/PUT-main', '/home/user5/anaconda3/envs/testenv/lib/python3.8/site-packages', '/home/user5/.pycharm_helpers/pycharm_matplotlib_backend']

后台训练

1
nohup python -u main.py >02272115_loss.log 2>&1 &

GIQA升级版FIQA

  • Best model?
1
2
- checkpoints/acc01090300/model_best.pth.tar
- /home/user5/code/QA/GIQA-master/MBC-GIQA/checkpoints/acc01090300/model_best.pth.tar
  • Freeze pretrained layer

(29 封私信 / 7 条消息) Pytorch 如何精确的冻结我想冻结的预训练模型的某一层,有什么命令吗? - 知乎 (zhihu.com)

算法工程师升级打怪

  • 成为一个算法工程师首先你得有工程能力,就是说你得先能干活,熟练的掌握一门编程语言必不可少;

  • 然后是相关领域的专业知识,比如推荐算法,你需要了解常见推荐算法的原理、优缺点、应用场景等;

  • 然后是机器学习的基础知识,李航的《统计机器学习》,周志华的《机器学习》,Benjio的《深度学习》,这三本书至少得过个那么一两遍吧,把基础知识掌握牢了再学习其它的就容易多了,基础不牢地动山摇;

  • 然后是掌握一些数据结构和算法知识,这个还是比较重要的,对你写出高效的代码很有帮助。

Issues | Baseline MISF-CVPR2022 Reprod & GIQA improve

https://jennyvanessa.github.io/2023/02/28/2302281930/

Author

Vanessa Ni

Posted on

2023-02-28

Updated on

2023-02-28

Licensed under

Comments

You need to set client_id and slot_id to show this AD unit. Please set it in _config.yml.