lindsey98 / Phishpedia

Official Implementation of "Phishpedia: A Hybrid Deep Learning Based Approach to Visually Identify Phishing Webpages" USENIX'21
Creative Commons Zero v1.0 Universal
129 stars 45 forks source link

Missing keys in loading state_dict for ResNetV2 and can't load "BiT-M-R50x1.npz" #9

Closed gyNancy closed 2 years ago

gyNancy commented 2 years ago

Hi I'm trying to do the Siamese retrain.

  1. When I run evaluate.py file, I got the following error.

Traceback (most recent call last): File "evaluate.py", line 155, in model.load_state_dict(new_state_dict) File "/xxx/lib64/python3.6/site-packages/torch/nn/modules/module.py", line 1483, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for ResNetV2: Missing key(s) in state_dict: "root.conv.weight",....

And also the error of: Unexpected key(s) in state_dict: "ean", "td", "e.fpn_lateral2.weight", "e.fpn_lateral2.bias"...

  1. The other thing is that when I load "BiT-M-R50x1.npz", I got the this error:

    np.load("BiT-M-R50x1.npz") Traceback (most recent call last): File "", line 1, in File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/lib/npyio.py", line 398, in load "Failed to interpret file %s as a pickle" % repr(file)) IOError: Failed to interpret file 'BiT-M-R50x1.npz' as a pickle

Thanks!

lindsey98 commented 2 years ago

Hi, thanks for raising the issue,

  1. I corrected the bug at line 145, the model is supposed to be the Siamese model instead of the Detection model
  2. Did you run this command to get BiT-M-R50x1.npz?
    wget https://storage.googleapis.com/bit_models/BiT-M-R50x1.npz