ZHOUXINWEN / 2019Baidu-XJTU_URFC

2019Baidu&XJTU_URFC Preliminary Round Code
32 stars 9 forks source link

provided module on BaiduNetDisk #1

Closed lzyplayer closed 1 year ago

lzyplayer commented 5 years ago

Thanks for your generous work! Question here~ how to run the provided module downloaded form BaiduNetDisk ? XD

ZHOUXINWEN commented 5 years ago

You can find the information of model in recoder.odt '/home/zxw/2019BaiduXJTU/weights/MultiModal_se_resnext50_32x4d_resample_pretrained/BDXJTU2019_SGD_16.pth' '/home/zxw/2019BaiduXJTU/weights/MultiModal_50_MS_resample_pretrained_HR/BDXJTU2019_SGD_26.pth' '/home/zxw/2019BaiduXJTU/weights/MultiModal_se_resnext50_32x4d_resample_pretrained_w/BDXJTU2019_SGD_50.pth' '/home/zxw/2019BaiduXJTU/weights/MultiModal_se_resnext50_32x4d_resample_pretrained_1/BDXJTU2019_SGD_80.pth' by running MM_val_ensemble.py You will have the results.

lzyplayer commented 5 years ago

Many thanks!

lzyplayer commented 5 years ago

Thanks for your reply! Somehow the code still need these two pretrained model while dealing with ./basenet/multimodal.py

  1. '/home/zxw/2019BaiduXJTU/se_resnext50_32x4d-a260b3a4.pth'
  2. '/home/zxw/2019BaiduXJTU/se_resnet50-ce0d4300.pth' What are the difference between these two model and the model you provided on netdisk ? Would you mind adding them to your baiduNetDisk? :)
ZHOUXINWEN commented 5 years ago

These two models are the pretrained models for training. Models on netdisk is the final model for testing You can download these two models on http://data.lip6.fr/cadene/pretrainedmodels/se_resnet50-ce0d4300.pth http://data.lip6.fr/cadene/pretrainedmodels/se_resnext50_32x4d-a260b3a4.pth

In basenet/senet.py you can find more pretrained models.

lzyplayer commented 5 years ago

Thanks for your explanation! Learned a lot from your work! yet very curious about how you merge multi_model~ And I think I'm almost there with all the model put in the right places. However, I've run in to this RuntimeError while running both in GeResult.py(get result with one model(iguess?),GeResult_ensemble.py(get result with four model merged(iguess?)) ) :

Username@room:~/Username/2019Baidu-XJTU_URFC/2019BaiduXJTU$ python GeResult_ensemble.py
/home/Username/anaconda3/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  return f(*args, **kwds)
/home/Username/anaconda3/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  return f(*args, **kwds)
/home/Username/anaconda3/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility
  return f(*args, **kwds)
import complete
load pretrained model from /home/Username/2019Baidu-XJTU_URFC/2019BaiduXJTU/model/pretrained_model/se_resnext50_32x4d-a260b3a4.pth
load model from /home/Username/2019Baidu-XJTU_URFC/2019BaiduXJTU/model/pretrained_model/se_resnext50_32x4d-a260b3a4.pth
load pretrained model from /home/Username/2019Baidu-XJTU_URFC/2019BaiduXJTU/model/pretrained_model/se_resnext50_32x4d-a260b3a4.pth
load pretrained model from /home/Username/2019Baidu-XJTU_URFC/2019BaiduXJTU/model/pretrained_model/se_resnext50_32x4d-a260b3a4.pth
Traceback (most recent call last):
  File "GeResult_ensemble.py", line 67, in <module>
    GeResult()
  File "GeResult_ensemble.py", line 48, in GeResult
    net4.load_state_dict(torch.load('/home/Username/2019Baidu-XJTU_URFC/2019BaiduXJTU/model/BDXJTU2019_SGD_80.pth'))
  File "/home/Username/lib/python3.6/site-packages/torch/serialization.py", line 387, in load
    return _load(f, map_location, pickle_module, **pickle_load_args)
  File "/home/Username/lib/python3.6/site-packages/torch/serialization.py", line 581, in _load
    deserialized_objects[key]._set_from_file(f, offset, f_should_read_directly)
RuntimeError: storage has wrong size: expected 7595430114468248624 got 1024

wonder if you could help out on this one :) ? im using test data from https://github.com/czczup/UrbanRegionFunctionClassification

ps: why do GeResult_ensemble.py need pretrained model se_resnext50_32x4d-a260b3a4.pth, I thought it only merge the four model you provided on BaiduNetdisk

destiny19960207 commented 5 years ago

I suffered the following problems, too. RuntimeError: storage has wrong size: expected 7595430114468248624 got 1024

By modifying the following code in GeResult_ensemble.py, I got one result by using only three models. net4 =MultiModalNet('se_resnext80_32x4d', 'DPN26', 0.5) net4.load_state_dict(torch.load('pretrained/BDXJTU2019_SGD_80.pth')) net4.eval() -------> net4 =MultiModalNet('se_resnext50_32x4d', 'DPN26', 0.5) net4.load_state_dict(torch.load('pretrained/BDXJTU2019_SGD_50.pth')) net4.eval()

sunlanchang commented 5 years ago

I suffered the following problems, too. RuntimeError: storage has wrong size: expected 7595430114468248624 got 1024

By modifying the following code in GeResult_ensemble.py, I got one result by using only three models. net4 =MultiModalNet('se_resnext80_32x4d', 'DPN26', 0.5) net4.load_state_dict(torch.load('pretrained/BDXJTU2019_SGD_80.pth')) net4.eval() -------> net4 =MultiModalNet('se_resnext50_32x4d', 'DPN26', 0.5) net4.load_state_dict(torch.load('pretrained/BDXJTU2019_SGD_50.pth')) net4.eval()

I meet the same issue. BDXJTU2019_SGD_80.pth is the most accurate model, there will be a low accurate result if miss the model weight. Hoping author help solve the issue. @ZHOUXINWEN