IDSGAN RunTime error

Hi !
I’m new to pytorch and try to run IDSGAN. (https://github.com/imoken1122/IDSGAN)
I got RunTime error(below) during running IDS-WGAN.py


Traceback (most recent call last):
File “C:/논문/IDSGAN-master/IDSGAN-master/IDS_WGAN.py”, line 47, in
ids_model.load_state_dict(param)
File “C:\anaconda3\envs\tutorial\lib\site-packages\torch\nn\modules\module.py”, line 830, in load_state_dict
self.class.name, “\n\t”.join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for Blackbox_IDS:
size mismatch for layer.6.weight: copying a param with shape torch.Size([33, 66]) from checkpoint, the shape in current model is torch.Size([16, 66]).
size mismatch for layer.6.bias: copying a param with shape torch.Size([33]) from checkpoint, the shape in current model is torch.Size([16]).
size mismatch for layer.9.weight: copying a param with shape torch.Size([16, 33]) from checkpoint, the shape in current model is torch.Size([16, 16]).

Waiting for your help. Thanks.

The model from which you are loading the checkpoint from and the model that you are currently using differ in certain layers as mentioned in the traceback. I just had a look at the model. Did you tweak the input to the model instantiation? I have pasted some code from the tutorial below to clarify the question.

D_G_INPUT_DIM = len(train_data.columns) --> Are you using different train data?
ids_model = Blackbox_IDS(D_G_INPUT_DIM,2) --> What is your D_G_INPUT_DIM?
param = th.load(‘save_model/IDS.pth’)
ids_model.load_state_dict(param)