Skip to content

RuntimeError when 'inference_batch_size' > 1 #83

@tomrunia

Description

@tomrunia

I believe there is a small bug with setting the inference batch size > 1. For example, when running:

python main.py --model FlowNet2 --resume /path/to/dir/flownet2-pytorch/pretrained/FlowNet2_checkpoint.pth.tar --skip_training --skip_validation --inference_dataset ImagesFromFolder --inference_dataset_root ./path/with/images/  --inference_dataset_iext jpg --inference --save_flow --inference_batch_size 2

The following error is thrown:

File "/path/to/dir/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/path/to/dir/flownet2-pytorch/losses.py", line 21, in forward
    lossvalue = torch.abs(output - target).mean()
RuntimeError: The size of tensor a (2) must match the size of tensor b (3) at non-singleton dimension 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions