mattpfr / lmanet

GNU General Public License v3.0
8 stars 2 forks source link

Code problem #8

Open Michelexiaoxiao opened 1 year ago

Michelexiaoxiao commented 1 year ago

When the backbone is ‘psp101’,the error is as follow:

File “/data01/wmt/lmanet-main/models/lmanet.py”, line 437, in forward assert((input_size[2]-1)%8 == 0 and (input_size[3]-1)%8 == 0 ) AssertionError

How to solve this problem?

lukazso commented 7 months ago

https://github.com/mattpfr/lmanet/blob/4419f12b0b33247b91be9247effc067a25afef63/models/lmanet.py#L401-L411

Change this to:

for t in memory_range:

    if self.backbone == "psp101":
        input_frame_t = input[:, t, :, :, :].squeeze(1)
        input_size = input_frame_t.size()
        assert((input_size[2]-1) % 8 == 0 and (input_size[3]-1) % 8 == 0)

        h = int((input_size[2] - 1) / 8 * self.zoom_factor + 1)
        w = int((input_size[3] - 1) / 8 * self.zoom_factor + 1)

    encoder_output = self.encoder(input_frame_t)