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

size of input tensor and input format are different #12

Closed
li-pengcheng opened this issue Jan 13, 2019 · 1 comment
Closed

size of input tensor and input format are different #12

li-pengcheng opened this issue Jan 13, 2019 · 1 comment

Comments

@li-pengcheng
Copy link

li-pengcheng commented Jan 13, 2019

@Ugness good work! I met some trouble when i use train.py in the pytorch/.
It say:
Traceback (most recent call last):
File "train.py", line 106, in
writer.add_image('{}'.format(masked.size()[2]), masked, global_step=iterate)
File "/data/lipengcheng/programs/anaconda3/envs/pytorch/lib/python3.5/site-packages/tensorboardX/writer.py", line 427, in add_image
image(tag, img_tensor, dataformats=dataformats), global_step, walltime)
File "/data/lipengcheng/programs/anaconda3/envs/pytorch/lib/python3.5/site-packages/tensorboardX/summary.py", line 211, in image
tensor = convert_to_HWC(tensor, dataformats)
File "/data/lipengcheng/programs/anaconda3/envs/pytorch/lib/python3.5/site-packages/tensorboardX/utils.py", line 98, in convert_to_HWC
assert(len(tensor.shape) == len(input_format)), "size of input tensor and input format are different"
AssertionError: size of input tensor and input format are different

It seems the input size is [1,1,28,28] but the input_format just need [1,28,28] without batch_size? but i don't know how to modify it, could U give me a hand?

@li-pengcheng
Copy link
Author

oooops! Things sounds like my tensorboardX version is too high, when I down it to 1.1, the problem has been solved!

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

1 participant