While running the standalone demo in SFM_fpn.py, several small runtime
issues were encountered. This report summarizes the problems and may
help improve robustness of the implementation.
1. NameError: dilation is not defined in MSLPRM_efficient.__init__
In the constructor of MSLPRM_efficient, the following block produces
an error:
padding=dilation * (kernel_size // 2) # 'dilation' is not defined here
The correct variable appears to be dilations[i].
This leads to:
NameError: name 'dilation' is not defined. Did you mean: 'dilations'?
2. Incorrect Iteration Over ModuleList Objects
The loop:
for (lpr_conv, lprm) in (self.lpr_convs, self.lpr_modules):
attempts to unpack two ModuleLists into layer‑wise pairs, causing:
ValueError: too many values to unpack (expected 2)
A corrected version should explicitly zip the lists:
for lpr_conv, lprm in zip(self.lpr_convs, self.lpr_modules):
3. NameError: undefined variables (n, h, w) in LPRM_efficient.forward
Near the end of forward, the following line appears:
refined_unshuffled = self.carafe_op(
unshuffled_value,
unshuffled_mask.softmax(dim=1).view(n, -1, h, w)
)
However, n, h, and w are never defined, producing:
NameError: name 'n' is not defined. Did you mean: 'nn'?
These should likely correspond to:
n = B * self.scale_sq
h, w = Hs, Ws
After patching these issues locally, the demo at the bottom of
SFM_fpn.py runs successfully and outputs the expected tensor shapes.
Closing Note
Thanks again for releasing this excellent work and codebase.
These small fixes should help improve ease of use for others running the demo.
While running the standalone demo in
SFM_fpn.py, several small runtimeissues were encountered. This report summarizes the problems and may
help improve robustness of the implementation.
1.
NameError:dilationis not defined inMSLPRM_efficient.__init__In the constructor of
MSLPRM_efficient, the following block producesan error:
The correct variable appears to be
dilations[i].This leads to:
2. Incorrect Iteration Over
ModuleListObjectsThe loop:
attempts to unpack two
ModuleListsinto layer‑wise pairs, causing:A corrected version should explicitly zip the lists:
3.
NameError: undefined variables (n,h,w) inLPRM_efficient.forwardNear the end of
forward, the following line appears:However,
n,h, andware never defined, producing:These should likely correspond to:
n = B * self.scale_sqh, w = Hs, WsAfter patching these issues locally, the demo at the bottom of
SFM_fpn.pyruns successfully and outputs the expected tensor shapes.Closing Note
Thanks again for releasing this excellent work and codebase.
These small fixes should help improve ease of use for others running the demo.