sstary / SSRS

Apache License 2.0
317 stars 38 forks source link

FTransUNet:pretrain model error #37

Closed learning-mamba closed 2 months ago

learning-mamba commented 2 months ago

Traceback (most recent call last): File "E:\FTransUNet\train.py", line 41, in net.load_from(weights=np.load(config_vit.pretrained_path)) File "E:\FTransUNet\model\vitcross_seg_modeling.py", line 584, in load_from unit.load_from(weights, n_block=uname) File "E:\FTransUNet\model\vitcross_seg_modeling.py", line 316, in load_from query_weight = np2th(weights[pjoin(ROOT, ATTENTION_Q, "kernel")]).view(self.hidden_size, self.hidden_size).t() File "E:\Anaconda\envs\bigyu\lib\site-packages\numpy\lib\npyio.py", line 263, in getitem raise KeyError(f"{key} is not a file in the archive") KeyError: 'Transformer/encoderblock_0\MultiHeadDotProductAttention_1/query\kernel is not a file in the archive'

sstary commented 2 months ago

你好,请参考 https://github.com/jeonsworld/ViT-pytorch/issues/11

learning-mamba commented 2 months ago

你好,请参考 jeonsworld/ViT-pytorch#11

谢谢,他是有效的