Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
luluning opened this issue Apr 19, 2019 · 6 comments
Open

Comments

@luluning
Copy link

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

@Rongtao-Xu
Copy link

I get the same problem,did you solve it?

@yongyixiao
Copy link

I get the same problem,did you solve it

I also get the same problem,did you solve it

@luluning
Copy link
Author

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.

@yongyixiao
Copy link

yongyixiao commented May 10, 2019 via email

@adityaarun1
Copy link
Contributor

See #126

@Spark001
Copy link

Maybe you can use version like these:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants