GriffinLiang / vrd-dsr

Code for Visual Relationship Detection with Deep Structural Ranking (AAAI2018)
122 stars 32 forks source link

Error when training with loc_type=1 #21

Open jiahaoli95 opened 6 years ago

jiahaoli95 commented 6 years ago

I tried to run ~/tools/train.py with params --dataset vrd --loc_type 1 but got the following error.

Namespace(ds_name='vrd', epochs=5, loc_type=1, lr=1e-05, model_type=None, name=None, print_freq=10, resume='', start_epoch=0, use_obj=True, use_obj_prior=True, use_so=True) Traceback (most recent call last): File "train.py", line 119, in train_net(train_data_layer, net, epoch, args) File "/home/ljh/vrd_dsr/vrd-dsr/tools/../lib/model.py", line 28, in train_net obj_score, rel_score = net(image_blob, boxes, rel_boxes, SpatialFea, classes, ix1, ix2, args) File "/home/ljh/anaconda2/envs/caffe2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 477, in call result = self.forward(*input, kwargs) File "/home/ljh/vrd_dsr/vrd-dsr/tools/../lib/nets/Vrd_Model.py", line 119, in forward lo = self.fc_lov(SpatialFea) File "/home/ljh/anaconda2/envs/caffe2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 477, in call result = self.forward(*input, *kwargs) File "/home/ljh/vrd_dsr/vrd-dsr/tools/../lib/network.py", line 30, in forward x = self.fc(x) File "/home/ljh/anaconda2/envs/caffe2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 477, in call result = self.forward(input, kwargs) File "/home/ljh/anaconda2/envs/caffe2/lib/python2.7/site-packages/torch/nn/modules/linear.py", line 55, in forward return F.linear(input, self.weight, self.bias) File "/home/ljh/anaconda2/envs/caffe2/lib/python2.7/site-packages/torch/nn/functional.py", line 1026, in linear output = input.matmul(weight.t()) RuntimeError: size mismatch, m1: [320 x 32], m2: [8 x 256] at /pytorch/aten/src/THC/generic/THCTensorMathBlas.cu:249

Any solutions? Thank you!

lileilai commented 5 years ago

@jiahaowork have you solve the problem of "loc_type=1" ? thanks

jiahaoli95 commented 5 years ago

@lileilai No, it won't work.