NLDF-pytorch icon indicating copy to clipboard operation
NLDF-pytorch copied to clipboard

Error running the code

Open fabiopoiesi opened this issue 6 years ago • 2 comments

Hi,

I am trying to run this code, but there is an error:

Missing key(s) in state_dict: "base.0.weight", "base.0.bias", "base.2.weight", "base.2.bias", "base.5.weight", "base.5.bias", "base.7.weight", "base.7.bias", "base.10.weight", "base.10.bias", "base.12.weight", "base.12.bias", "base.14.weight", "base.14.bias", "base.17.weight", "base.17.bias", "base.19.weight", "base.19.bias", "base.21.weight", "base.21.bias", "base.24.weight", "base.24.bias", "base.26.weight", "base.26.bias", "base.28.weight", "base.28.bias", "feat.0.conv1.weight", "feat.0.conv1.bias", "feat.1.conv1.weight", "feat.1.conv1.bias", "feat.2.conv1.weight", "feat.2.conv1.bias", "feat.3.conv1.weight", "feat.3.conv1.bias", "feat.4.conv1.weight", "feat.4.conv1.bias", "pool.0.weight", "pool.0.bias", "pool.1.weight", "pool.1.bias", "pool.2.weight", "pool.2.bias", "pool.3.weight", "pool.3.bias", "pool.4.weight", "pool.4.bias", "glob.0.weight", "glob.0.bias", "glob.2.weight", "glob.2.bias", "glob.4.weight", "glob.4.bias", "conv_g.weight", "conv_g.bias", "conv_l.weight", "conv_l.bias". Unexpected key(s) in state_dict: "0.weight", "0.bias", "2.weight", "2.bias", "5.weight", "5.bias", "7.weight", "7.bias", "10.weight", "10.bias", "12.weight", "12.bias", "14.weight", "14.bias", "17.weight", "17.bias", "19.weight", "19.bias", "21.weight", "21.bias", "24.weight", "24.bias", "26.weight", "26.bias", "28.weight", "28.bias".

The error occurs when I launch demo.py at the line: net.load_state_dict(torch.load(model_path))

I'm using Pytorch 1.0.

Cheers

fabiopoiesi avatar Jan 25 '19 07:01 fabiopoiesi

I will update the pre-trained model (the older version is pytorch0.3, and the bn layers is changed after 0.4.1) You can download with this link: https://drive.google.com/open?id=1v2LRWjfmbQc8VREX39LopX4v-Rd3YEOm

this performance may not as well as paper (I use too small batch size and less epoch)

AceCoooool avatar Jan 25 '19 07:01 AceCoooool

OK. I will try. Please ping when you've done the update.

EDIT: with this model, it works.

Cheers

fabiopoiesi avatar Jan 25 '19 07:01 fabiopoiesi