Closed kmliy901054 closed 10 months ago
I am currently encountering an issue in my code and am seeking your expertise for guidance.
Error Message:
Traceback (most recent call last): File "train.py", line 184, in net.load_from(weights=np.load(config_vit.pretrained_path)) File "A:\DP_learn\DA-TransUnet-main\DA-TransUNet\DA-TransUNet\Architecture\DATransUNet.py", line 459, in load_from unit.load_from(weights, n_block=uname) File "A:\DP_learn\DA-TransUnet-main\DA-TransUNet\DA-TransUNet\Architecture\DATransUNet.py", line 209, in load_from query_weight = np2th(weights[pjoin(ROOT, ATTENTION_Q, "kernel")]).view(self.hidden_size, self.hidden_size).t() File "C:\Users\Wayne.conda\envs\DA\lib\site-packages\numpy\lib\npyio.py", line 260, in getitem raise KeyError("%s is not a file in the archive" % key) KeyError: 'Transformer/encoderblock_0\MultiHeadDotProductAttention_1/query\kernel is not a file in the archive'
I have checked the paths and files, but I am still unable to resolve the issue. I am uncertain whether the 'Transformer/encoderblock_0\MultiHeadDotProductAttention_1/query\kernel' path is correct or if there is a missing file.
i found it in R50+ViT-B_16.npz
I am currently encountering an issue in my code and am seeking your expertise for guidance.
Error Message:
Traceback (most recent call last): File "train.py", line 184, in
net.load_from(weights=np.load(config_vit.pretrained_path))
File "A:\DP_learn\DA-TransUnet-main\DA-TransUNet\DA-TransUNet\Architecture\DATransUNet.py", line 459, in load_from
unit.load_from(weights, n_block=uname)
File "A:\DP_learn\DA-TransUnet-main\DA-TransUNet\DA-TransUNet\Architecture\DATransUNet.py", line 209, in load_from
query_weight = np2th(weights[pjoin(ROOT, ATTENTION_Q, "kernel")]).view(self.hidden_size, self.hidden_size).t()
File "C:\Users\Wayne.conda\envs\DA\lib\site-packages\numpy\lib\npyio.py", line 260, in getitem
raise KeyError("%s is not a file in the archive" % key)
KeyError: 'Transformer/encoderblock_0\MultiHeadDotProductAttention_1/query\kernel is not a file in the archive'
I have checked the paths and files, but I am still unable to resolve the issue. I am uncertain whether the 'Transformer/encoderblock_0\MultiHeadDotProductAttention_1/query\kernel' path is correct or if there is a missing file.