Skip to content

Limitations on input image size #30

@Alf-Z-SymphoMe

Description

@Alf-Z-SymphoMe

Hi, I tried loading a few scores (png and pdf), but I got the error message below.
I managed to make the model work with a much smaller score, as I read in an other issue that exists a maximum amount of allowed pixels per each dimension. If there is no solution yet, I'll leave it as an issue.

predictions, _ = model.predict(convert_img_to_tensor(image).unsqueeze(0).to(device),
File "site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
File "smt_model/modeling_smt.py", line 406, in predict
output = self.forward_decoder(encoder_output=encoder_output, last_predictions=predicted_sequence,
File "smt_model/modeling_smt.py", line 372, in forward_decoder
encoder_output_2D = self.pos2D(encoder_output)
File "site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
File "smt_model/modeling_smt.py", line 41, in forward
return x + self.get_pe_by_size(x.size(-2), x.size(-1))
RuntimeError: The size of tensor a (263) must match the size of tensor b (16) at non-singleton dimension 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions