ViTAE-Transformer / ViTAE-Transformer-Remote-Sensing

A comprehensive list [SAMRS@NeurIPS'23, RVSA@TGRS'22, RSP@TGRS'22] of our research works related to remote sensing, including papers, codes, and citations. Note: The repo for [TGRS'22] "An Empirical Study of Remote Sensing Pretraining" has been moved to: https://github.com/ViTAE-Transformer/RSP
438 stars 53 forks source link

模型预训练权重在哪下载 #8

Closed zgsxwsdxg closed 1 year ago

zgsxwsdxg commented 1 year ago

你好!我在训练是发生找不到权重 VitAE_window/output/ViTAE_Window_NoShift_12_basic_stages4_14_224/epoch100/ViTAE_Window_NoShift_12_basic_stages4_14/default/ckpt.pth

DotWang commented 1 year ago

仓库主页

zgsxwsdxg commented 1 year ago

仓库主页

下载的文件名字是bit-rsp-vitaev2-s-levir-ckpt.pth和VitAE_window/output/ViTAE_Window_NoShift_12_basic_stages4_14_224/epoch100/ViTAE_Window_NoShift_12_basic_stages4_14/default/ckpt.pth 是一个吗?

zgsxwsdxg commented 1 year ago

仓库主页

if self.args.mode == 'imp': pretrained = '../pretrain_model/ViTAE_Window_NoShift_12_basic_stages4_14_best.pth.tar' elif self.args.mode == 'rsp_40': pretrained = '../VitAE_window/output/ViTAE_Window_NoShift_12_basic_stages4_14_224/epoch40/ViTAE_Window_NoShift_12_basic_stages4_14/default/ckpt.pth' elif self.args.mode == 'rsp_100':

pretrained = '../VitAE_window/output/ViTAE_Window_NoShift_12_basic_stages4_14_224/epoch100/ViTAE_Window_NoShift_12_basic_stages4_14/default/ckpt.pth'

        pretrained = 'D:\\codes\\ViTAE-Transformer-Remote-Sensing\\ChangeDetection\\weights\\levir\\3\\bit-rsp-vitaev2-s-levir-ckpt.pth'
    else:
        raise NotImplementedError

    if isinstance(pretrained, str):

        ckpt = torch.load(pretrained, map_location='cpu')

        if 'state_dict' in ckpt:
            _state_dict = ckpt['state_dict']

用下载那个权重bit-rsp-vitaev2-s-levir-ckpt.pth 训练时if 'state_dict' in ckpt: 报错了 提示: Traceback (most recent call last): File "train-tmp.py", line 103, in model = load_model(opt, dev) File "D:\codes\ViTAE-Transformer-Remote-Sensing\ChangeDetection\utils\helpers.py", line 188, in load_model with_pos='learned', enc_depth=1, dec_depth=8).to(device) File "D:\codes\ViTAE-Transformer-Remote-Sensing\ChangeDetection\models\networks.py", line 476, in init if_upsample_2x=if_upsample_2x, File "D:\codes\ViTAE-Transformer-Remote-Sensing\ChangeDetection\models\networks.py", line 386, in init norm_eval=False File "D:\codes\ViTAE-Transformer-Remote-Sensing\ChangeDetection\models\ViTAE_Window_NoShift\base_model.py", line 191, in init self.init_weights() File "D:\codes\ViTAE-Transformer-Remote-Sensing\ChangeDetection\models\ViTAE_Window_NoShift\base_model.py", line 210, in init_weights if 'state_dict' in ckpt: TypeError: argument of type 'BASE_Transformer' is not iterable

zgsxwsdxg commented 1 year ago

仓库主页

你base_model.py文件中有好多预训练权重路径,

    if self.args.mode == 'imp':
        pretrained = '../pretrain_model/ViTAE_Window_NoShift_12_basic_stages4_14_best.pth.tar'
    elif self.args.mode == 'rsp_40':
        pretrained = '../VitAE_window/output/ViTAE_Window_NoShift_12_basic_stages4_14_224/epoch40/ViTAE_Window_NoShift_12_basic_stages4_14/default/ckpt.pth'
    elif self.args.mode == 'rsp_100':
        # pretrained = '../VitAE_window/output/ViTAE_Window_NoShift_12_basic_stages4_14_224/epoch100/ViTAE_Window_NoShift_12_basic_stages4_14/default/ckpt.pth'
        pretrained = 'D:\\codes\\ViTAE-Transformer-Remote-Sensing\\ChangeDetection\\weights\\levir\\3\\bit-rsp-vitaev2-s-levir-ckpt.pth'
    else:
        raise NotImplementedError

我添加了下载的 pretrained = 'D:\codes\ViTAE-Transformer-Remote-Sensing\ChangeDetection\weights\levir\3\bit-rsp-vitaev2-s-levir-ckpt.pth'

DotWang commented 1 year ago

不是那个变化监测的主页,是总的主页

DotWang commented 1 year ago

https://github.com/ViTAE-Transformer/ViTAE-Transformer-Remote-Sensing

DotWang commented 1 year ago

变化检测分割之类的任务文件夹里边的模型是训练好的模型,不是预训练模型 预训练模型在本仓库主页,关于vitae,遥感这个仓库这里只提供了rsp-vitaev2-s-e100的 imp的在同项目的其他仓库中:https://github.com/ViTAE-Transformer/ViTAE-Transformer/tree/main/Image-Classification

zgsxwsdxg commented 1 year ago

项目

谢谢,rsp-vitaev2-s-e100 这个可以训起来了。 但是 if self.args.mode == 'imp': pretrained = '../pretrain_model/ViTAE_Window_NoShift_12_basic_stages4_14_best.pth.tar' 这个找不到时对应哪一个,仓库中:https://github.com/ViTAE-Transformer/ViTAE-Transformer/tree/main/Image-Classification有好多个,帮忙指点下,谢谢

DotWang commented 1 year ago

ViTAEv2-S那个

zgsxwsdxg commented 1 year ago

ViTAEv2-S那个

好了,可以了。
elif self.args.mode == 'rsp_40': pretrained = '../VitAE_window/output/ViTAE_Window_NoShift_12_basic_stages4_14_224/epoch40/ViTAE_Window_NoShift_12_basic_stages4_14/default/ckpt.pth' 这个是对应那个?

DotWang commented 1 year ago

这个不需要了,已经有epoch100的了,文章里边的实验已经表明40的不如100的,所以我就没放

zgsxwsdxg commented 1 year ago

这个不需要了,已经有epoch100的了,文章里边的实验已经表明40的不如100的,所以我就没放

ok,好的,谢谢。