One-paper-luck / MG-Transformer

MIT License
7 stars 1 forks source link

缺少文件 #2

Open Dingxiangtao opened 2 months ago

Dingxiangtao commented 2 months ago

FileNotFoundError: [Errno 2] No such file or directory: '/media/dmd/ours/mlw/pre_model/resnet152.pth' 前辈,这个media文件夹应该去哪里获取呢?

One-paper-luck commented 2 months ago

用的torch提供的预训练模型,下载地址网上搜一下就好了

---- 回复的原邮件 ---- | 发件人 | @.> | | 发送日期 | 2024年07月09日 10:33 | | 收件人 | One-paper-luck/MG-Transformer @.> | | 抄送人 | Subscribed @.***> | | 主题 | [One-paper-luck/MG-Transformer] 缺少文件 (Issue #2) |

FileNotFoundError: [Errno 2] No such file or directory: '/media/dmd/ours/mlw/pre_model/resnet152.pth' 前辈,这个media文件夹应该去哪里获取呢?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Dingxiangtao commented 2 months ago

Traceback (most recent call last): File "train.py", line 290, in train_loss = train_xe(model, dataloader_train, optim, text_field) File "train.py", line 98, in train_xe out = model(detections, detections_gl, detections_mask, captions, isencoder=True) File "/home/tcs/anaconda3/envs/m2/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, kwargs) File "/home/tcs/aaa/dxt/MG-Transformer-main/models/transformer/transformer.py", line 29, in forward enc_output, mask_enc = self.encoder(images, images_gl,detections_mask,isencoder=isencoder) File "/home/tcs/anaconda3/envs/m2/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, *kwargs) File "/home/tcs/aaa/dxt/MG-Transformer-main/models/transformer/encoders.py", line 91, in forward input_gl = F.relu(self.fc_clip(input_gl)) File "/home/tcs/anaconda3/envs/m2/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(input, kwargs) File "/home/tcs/anaconda3/envs/m2/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 103, in forward return F.linear(input, self.weight, self.bias) File "/home/tcs/anaconda3/envs/m2/lib/python3.6/site-packages/torch/nn/functional.py", line 1848, in linear return torch._C._nn.linear(input, weight, bias) RuntimeError: mat1 and mat2 shapes cannot be multiplied (2450x512 and 768x512) 前辈,很抱歉这么晚了打扰你,我处理完特征后运行train.py报这个错误,是什么原因呢?按理说应该不会出现维度错误吧。难道预训练权重用的不对

Dingxiangtao commented 2 months ago

前辈,问题解决了,MemoryAugmentedEncoder中clip维度应该改为512,那这个768对应的是那个数据集的维度呢