hmorimitsu / ptlflow

PyTorch Lightning Optical Flow models, scripts, and pretrained weights.
Apache License 2.0
250 stars 33 forks source link

AttributeError: 'IOAdapter' object has no attribute 'unpad' #23

Closed duckduck-sys closed 2 years ago

duckduck-sys commented 2 years ago

Following the colab example , the line:

# Some padding may have been added during prepare_inputs. The line below ensures that the padding is removed
# to make the predictions have the same size as the original images.
predictions = io_adapter.unpad(predictions)

gives the error

AttributeError: 'IOAdapter' object has no attribute 'unpad'

A simple fix seems to be to replace the line with

predictions = io_adapter.unpad_and_unscale(predictions)

which makes the example run. Is this correct?

hmorimitsu commented 2 years ago

Yes, that is correct. Thank you for reporting this error. I will update the example later.

zplizzi commented 2 years ago

It is still incorrect here: https://ptlflow.readthedocs.io/en/latest/starting/inference.html

hmorimitsu commented 2 years ago

Thank you for the update! I will push a fix soon.

hmorimitsu commented 2 years ago

Docs were fixed in #29 .