DUTCode
DUTCode copied to clipboard
issue in loading difnet model
Traceback (most recent call last):
File "./scripts/DIFRINTStabilizer.py", line 105, in
fhat, I_int = DIFNet(fr_g1, fr_g3, fr_o2,
File "/home/nikesh/stabl/venv/lib/python3.8/site-packages/torch/nn/modules/module.py", l
return forward_call(*input, **kwargs)
File "/home/nikesh/stabl/venv/lib/python3.8/site-packages/torch/nn/parallel/data_paralle
return self.module(*inputs[0], **kwargs[0])
File "/home/nikesh/stabl/venv/lib/python3.8/site-packages/torch/nn/modules/module.py", l
return forward_call(*input, **kwargs)
File "/home/nikesh/stabl/DUTCode/models/DIFRINT/models.py", line 323, in forward
w1, flo1 = self.warpFrame(fs2, fr1, scale=scale)
File "/home/nikesh/stabl/DUTCode/models/DIFRINT/models.py", line 318, in warpFrame
flo = 20.0 * torch.nn.functional.interpolate(input=self.pwc(temp_fr_1, temp_fr_2), siz
File "/home/nikesh/stabl/venv/lib/python3.8/site-packages/torch/nn/modules/module.py", l
return forward_call(*input, **kwargs)
File "/home/nikesh/stabl/DUTCode/models/DIFRINT/pwcNet.py", line 269, in forward
objectEstimate = self.moduleSix(tensorFirst[-1], tensorSecond[-1], None)
File "/home/nikesh/stabl/venv/lib/python3.8/site-packages/torch/nn/modules/module.py", l
return forward_call(*input, **kwargs)
File "/home/nikesh/stabl/DUTCode/models/DIFRINT/pwcNet.py", line 197, in forward
tensorVolume = self.moduleCorreleaky(self.moduleCorrelation(tensorFirst, tensorSecond)
File "/home/nikesh/stabl/venv/lib/python3.8/site-packages/torch/nn/modules/module.py", l
return forward_call(*input, **kwargs)
File "/home/nikesh/stabl/DUTCode/models/correlation/correlation.py", line 395, in forwar
return _FunctionCorrelation.apply(tenFirst, tenSecond)
File "/home/nikesh/stabl/DUTCode/models/correlation/correlation.py", line 286, in forwar
assert(first.is_contiguous() == True)
AssertionError
Stabiling using the DIFRINT model
Traceback (most recent call last):
File "./scripts/StabNetStabilizer.py", line 36, in
Hi Nikesh,
I was able to fix this error by adding 2 lines to ensure that the tensors being correlated are contiguous in memory.
That is, above the line: https://github.com/Annbless/DUTCode/blob/8b014e53961c1f059fe4afd937571bc18dedc6bf/models/correlation/correlation.py#L286
I added the lines:
first = first.contiguous() second = second.contiguous()
-Ishank
For the Errors in the StabNet model you can change the state_dict_load
line with the following answer:
https://stackoverflow.com/a/54058284/3642162
@nikeshkrishnan Hello, have you solved this problem? I had the same problem. Looking forward to your reply. You can also contact me by email. My email is [email protected]