justchenhao / STANet

official implementation of the spatial-temporal attention neural network (STANet) for remote sensing image change detection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

when I test the PAM model , I find the issue "AttributeError: 'PAM' object has no attribute 'query_conv'", the issue is like :

xautdestiny opened this issue · comments

dataset [ChangeDetectionDataset] was created
using mynet3 backbone
arch: mynet3
in_c: 3
ds: 1
model [CDFAModel] was created
loading the model from ./checkpoints/LEVIR-CDFA0/latest_net_F.pth
loading the model from ./checkpoints/LEVIR-CDFA0/latest_net_A.pth
Traceback (most recent call last):
File "test.py", line 113, in
val(opt)
File "test.py", line 47, in val
model.setup(opt) # regular setup: load and print networks; create schedulers
File "/data2/zhouyuan/CHANGE_PROJECT/STANet-master/STANet-master/models/base_model.py", line 119, in setup
self.load_networks(load_suffix)
File "/data2/zhouyuan/CHANGE_PROJECT/STANet-master/STANet-master/models/base_model.py", line 243, in load_networks
self.__patch_instance_norm_state_dict(state_dict, net, key.split('.'))
File "/data2/zhouyuan/CHANGE_PROJECT/STANet-master/STANet-master/models/base_model.py", line 213, in __patch_instance_norm_state_dict
self.__patch_instance_norm_state_dict(state_dict, getattr(module, key), keys, i + 1)
File "/data2/zhouyuan/CHANGE_PROJECT/STANet-master/STANet-master/models/base_model.py", line 213, in __patch_instance_norm_state_dict
self.__patch_instance_norm_state_dict(state_dict, getattr(module, key), keys, i + 1)
File "/data2/zhouyuan/anaconda3.5/envs/torch_py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 539, in getattr
type(self).name, name))
AttributeError: 'PAM' object has no attribute 'query_conv'

I got it ! I have found my error,Because I put the model name wrongly written.

Thanks for your attention. I think I can close this issue now.

I correctly write the model name, but I still get this error, please tell me where you modified!