pytorch-faster-rcnn icon indicating copy to clipboard operation
pytorch-faster-rcnn copied to clipboard

AssertionError: size of input tensor and input format are different.

Open luluning opened this issue 6 years ago • 6 comments

I want to train my own model,and I try ./experiments/scripts/train_faster_rcnn.sh 0 pascal_voc vgg16.I got an error message Loading initial model weights from data/imagenet_weights/vgg16.pth Loaded. Traceback (most recent call last): File "./tools/trainval_net.py", line 164, in max_iters=args.max_iters) File "/XXX/pytorch-faster-rcnn-master/tools/../lib/model/train_val.py", line 393, in train_net sw.train_model(max_iters) File "/XXX/pytorch-faster-rcnn-master/tools/../lib/model/train_val.py", line 286, in train_model self.net.train_step_with_summary(blobs, self.optimizer) File "/XXX/pytorch-faster-rcnn-master/tools/../lib/nets/network.py", line 501, in train_step_with_summary summary = self._run_summary_op() File "/XXX/pytorch-faster-rcnn-master/tools/../lib/nets/network.py", line 348, in _run_summary_op summaries.append(self._add_gt_image_summary()) File "/XXX/pytorch-faster-rcnn-master/tools/../lib/nets/network.py", line 66, in _add_gt_image_summary image[0].astype('float32') / 255.0) File "/XXX/lib/python3.7/site-packages/tensorboardX/summary.py", line 251, in image tensor = convert_to_HWC(tensor, dataformats) File "/XXX/lib/python3.7/site-packages/tensorboardX/utils.py", line 103, in convert_to_HWC tensor shape: {}, input_format: {}".format(tensor.shape, input_format) AssertionError: size of input tensor and input format are different. tensor shape: (375, 500, 3), input_format: NCHW Command exited with non-zero status 1 10.72user 3.29system 0:39.37elapsed 35%CPU (0avgtext+0avgdata 3427892maxresident)k 3184968inputs+0outputs (398major+817987minor)pagefaults 0swaps

luluning avatar Apr 19 '19 08:04 luluning

I get the same problem,did you solve it?

Rongtao-Xu avatar Apr 22 '19 09:04 Rongtao-Xu

I get the same problem,did you solve it

I also get the same problem,did you solve it

yongyixiao avatar May 10 '19 07:05 yongyixiao

I think there's something wrong with the tensorboardX,but I still don't solve it.You can search tensorboard and see some similar problems,maybe they can help you.

luluning avatar May 10 '19 07:05 luluning

ok,thank you。But instead i use the res101 net,i get the new problem :KeyError: 'resnet.conv1.weight'。

------------------ 原始邮件 ------------------ 发件人: "luluning"[email protected]; 发送时间: 2019年5月10日(星期五) 下午3:51 收件人: "ruotianluo/pytorch-faster-rcnn"[email protected]; 抄送: "Mvp_FerryMan"[email protected]; "Comment"[email protected]; 主题: Re: [ruotianluo/pytorch-faster-rcnn] AssertionError: size of inputtensor and input format are different. (#139)

I think there's something wrong with the tensorboardX,but I still don't solve it.You can search tensorboard and see some similar problems,maybe they can help you.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

yongyixiao avatar May 10 '19 08:05 yongyixiao

See #126

adityaarun1 avatar May 13 '19 07:05 adityaarun1

Maybe you can use version like these:

torch==0.4.1 torchvision==0.2.2 tensorboard==1.11.0 tensorboardX==1.4

Spark001 avatar Jun 12 '19 07:06 Spark001