Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue in loading difnet model #19

Open
nikeshkrishnan opened this issue Aug 3, 2022 · 3 comments
Open

issue in loading difnet model #19

nikeshkrishnan opened this issue Aug 3, 2022 · 3 comments

Comments

@nikeshkrishnan
Copy link

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
model.load_state_dict(r_model)
File "/home/nikesh/stabl/venv/lib/python3.8/site-packages/torch/nn/modules/module.py", l
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for stabNet:
Missing key(s) in state_dict: "resnet50.resnet_v2_50_block1_unit_1_bottleneck_v2_p_bottleneck_v2_preact_FusedBatchNorm.running_var", "resnet50.resnet_v2_50_block1_unit_1_boet_v2_50_block1_unit_1_bottleneck_v2_conv1_BatchNorm_FusedBatchNorm.running_var", "resnet5m.running_mean", "resnet50.resnet_v2_50_block1_unit_1_bottleneck_v2_conv2_BatchNorm_FusedB2_preact_FusedBatchNorm.running_mean", "resnet50.resnet_v2_50_block1_unit_2_bottleneck_v2__bottleneck_v2_conv1_BatchNorm_FusedBatchNorm.running_mean", "resnet50.resnet_v2_50_block1et50.resnet_v2_50_block1_unit_2_bottleneck_v2_conv2_BatchNorm_FusedBatchNorm.running_mean"edBatchNorm.running_var", "resnet50.resnet_v2_50_block1_unit_3_bottleneck_v2_preact_FusedBv2_preact_FusedBatchNorm.running_var", "resnet50.resnet_v2_50_block1_unit_3_bottleneck_v2_ck1_unit_3_bottleneck_v2_conv1_BatchNorm_FusedBatchNorm.running_var", "resnet50.resnet_v2_an", "resnet50.resnet_v2_50_block1_unit_3_bottleneck_v2_conv2_BatchNorm_FusedBatchNorm.runedBatchNorm.running_mean", "resnet50.resnet_v2_50_block2_unit_1_bottleneck_v2_preact_Fusedv2_conv1_BatchNorm_FusedBatchNorm.running_mean", "resnet50.resnet_v2_50_block2_unit_1_bottv2_50_block2_unit_1_bottleneck_v2_conv2_BatchNorm_FusedBatchNorm.running_mean", "resnet50.running_var", "resnet50.resnet_v2_50_block2_unit_2_bottleneck_v2_preact_FusedBatchNorm.runsedBatchNorm.running_var", "resnet50.resnet_v2_50_block2_unit_2_bottleneck_v2_conv1_BatchNottleneck_v2_conv1_BatchNorm_FusedBatchNorm.running_var", "resnet50.resnet_v2_50_block2_un50.resnet_v2_50_block2_unit_2_bottleneck_v2_conv2_BatchNorm_FusedBatchNorm.running_var", "running_mean", "resnet50.resnet_v2_50_block2_unit_3_bottleneck_v2_preact_FusedBatchNorm.ruchNorm_FusedBatchNorm.running_mean", "resnet50.resnet_v2_50_block2_unit_3_bottleneck_v2_co_unit_3_bottleneck_v2_conv2_BatchNorm_FusedBatchNorm.running_mean", "resnet50.resnet_v2_50, "resnet50.resnet_v2_50_block2_unit_4_bottleneck_v2_preact_FusedBatchNorm.running_mean", .running_var", "resnet50.resnet_v2_50_block2_unit_4_bottleneck_v2_conv1_BatchNorm_FusedBat_conv1_BatchNorm_FusedBatchNorm.running_var", "resnet50.resnet_v2_50_block2_unit_4_bottlen_50_block2_unit_4_bottleneck_v2_conv2_BatchNorm_FusedBatchNorm.running_var", "resnet50.res", "resnet50.resnet_v2_50_block3_unit_1_bottleneck_v2_preact_FusedBatchNorm.running_var", BatchNorm.running_mean", "resnet50.resnet_v2_50_block3_unit_1_bottleneck_v2_conv1_BatchNorleneck_v2_conv2_BatchNorm_FusedBatchNorm.running_mean", "resnet50.resnet_v2_50_block3_unitresnet_v2_50_block3_unit_2_bottleneck_v2_preact_FusedBatchNorm.running_mean", "resnet50.re", "resnet50.resnet_v2_50_block3_unit_2_bottleneck_v2_conv1_BatchNorm_FusedBatchNorm.runniNorm_FusedBatchNorm.running_var", "resnet50.resnet_v2_50_block3_unit_2_bottleneck_v2_conv2nit_2_bottleneck_v2_conv2_BatchNorm_FusedBatchNorm.running_var", "resnet50.resnet_v2_50_bl.resnet_v2_50_block3_unit_3_bottleneck_v2_preact_FusedBatchNorm.running_var", "resnet50.renning_mean", "resnet50.resnet_v2_50_block3_unit_3_bottleneck_v2_conv1_BatchNorm_FusedBatchnv2_BatchNorm_FusedBatchNorm.running_mean", "resnet50.resnet_v2_50_block3_unit_3_bottlenec_block3_unit_4_bottleneck_v2_preact_FusedBatchNorm.running_mean", "resnet50.resnet_v2_50_b.resnet_v2_50_block3_unit_4_bottleneck_v2_conv1_BatchNorm_FusedBatchNorm.running_mean", "rtchNorm.running_var", "resnet50.resnet_v2_50_block3_unit_4_bottleneck_v2_conv2_BatchNorm_Fneck_v2_conv2_BatchNorm_FusedBatchNorm.running_var", "resnet50.resnet_v2_50_block3_unit_5_0_block3_unit_5_bottleneck_v2_preact_FusedBatchNorm.running_var", "resnet50.resnet_v2_50_b "resnet50.resnet_v2_50_block3_unit_5_bottleneck_v2_conv1_BatchNorm_FusedBatchNorm.runningm_FusedBatchNorm.running_mean", "resnet50.resnet_v2_50_block3_unit_5_bottleneck_v2_conv2_B_6_bottleneck_v2_preact_FusedBatchNorm.running_mean", "resnet50.resnet_v2_50_block3_unit_60_block3_unit_6_bottleneck_v2_conv1_BatchNorm_FusedBatchNorm.running_mean", "resnet50.resning_var", "resnet50.resnet_v2_50_block3_unit_6_bottleneck_v2_conv2_BatchNorm_FusedBatchNor2_BatchNorm_FusedBatchNorm.running_var", "resnet50.resnet_v2_50_block4_unit_1_bottleneck_vt_1_bottleneck_v2_preact_FusedBatchNorm.running_var", "resnet50.resnet_v2_50_block4_unit_1esnet_v2_50_block4_unit_1_bottleneck_v2_conv1_BatchNorm_FusedBatchNorm.running_var", "resnNorm.running_mean", "resnet50.resnet_v2_50_block4_unit_1_bottleneck_v2_conv2_BatchNorm_Fusk_v2_preact_FusedBatchNorm.running_mean", "resnet50.resnet_v2_50_block4_unit_2_bottleneck_t_2_bottleneck_v2_conv1_BatchNorm_FusedBatchNorm.running_mean", "resnet50.resnet_v2_50_bloesnet50.resnet_v2_50_block4_unit_2_bottleneck_v2_conv2_BatchNorm_FusedBatchNorm.running_meFusedBatchNorm.running_var", "resnet50.resnet_v2_50_block4_unit_3_bottleneck_v2_preact_Fusck_v2_preact_FusedBatchNorm.running_var", "resnet50.resnet_v2_50_block4_unit_3_bottleneck_block4_unit_3_bottleneck_v2_conv1_BatchNorm_FusedBatchNorm.running_var", "resnet50.resnet__mean", "resnet50.resnet_v2_50_block4_unit_3_bottleneck_v2_conv2_BatchNorm_FusedBatchNorm.n", "resnet50.resnet_v2_50_postnorm_FusedBatchNorm.running_var", "resnet50.resnet_v2_50_

@ishank-juneja
Copy link

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:

assert(first.is_contiguous() == True)

I added the lines:
first = first.contiguous() second = second.contiguous()

-Ishank

@ishank-juneja
Copy link

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

@Bryson1234321
Copy link

@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 wsen34155@gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants