Chen-Yang-Liu / Change-Agent

Official PyTorch implementation of ''Change-Agent: Toward Interactive Comprehensive Remote Sensing Change Interpretation and Analysis"
MIT License
86 stars 7 forks source link

ModuleNotFoundError: No module named 'models_CC' #5

Open RemGisNJU opened 1 month ago

RemGisNJU commented 1 month ago

使用预训练模型运行predict.py出现ModuleNotFoundError: No module named 'models_CC',请问是为什么

Chen-Yang-Liu commented 1 month ago

使用预训练模型运行predict.py出现ModuleNotFoundError: No module named 'models_CC',请问是为什么

具体是哪一行代码报错呢?我重新测试了下没有发现这个问题

RemGisNJU commented 1 month ago

Traceback (most recent call last): File "D:\NJU\RSIC\Multi_change\predict.py", line 239, in Change_Perception = Change_Perception() File "D:\NJU\RSIC\Multi_change\predict.py", line 101, in init checkpoint = torch.load(snapshot_full_path) File "D:\miniconda3\envs\Multi_change_env\lib\site-packages\torch\serialization.py", line 809, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "D:\miniconda3\envs\Multi_change_env\lib\site-packages\torch\serialization.py", line 1172, in _load result = unpickler.load() File "D:\miniconda3\envs\Multi_change_env\lib\site-packages\torch\serialization.py", line 1165, in find_class return super().find_class(mod_name, name) ModuleNotFoundError: No module named 'models_CC' 您好!具体报错如上 如果手动创建models_CC会发现:AttributeError: Can't get attribute 'LEVIR_CC_CaptionModel' on <module 'models_CC' (namespace)>

Chen-Yang-Liu commented 1 month ago

Traceback (most recent call last): File "D:\NJU\RSIC\Multi_change\predict.py", line 239, in Change_Perception = Change_Perception() File "D:\NJU\RSIC\Multi_change\predict.py", line 101, in init checkpoint = torch.load(snapshot_full_path) File "D:\miniconda3\envs\Multi_change_env\lib\site-packages\torch\serialization.py", line 809, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "D:\miniconda3\envs\Multi_change_env\lib\site-packages\torch\serialization.py", line 1172, in _load result = unpickler.load() File "D:\miniconda3\envs\Multi_change_env\lib\site-packages\torch\serialization.py", line 1165, in find_class return super().find_class(mod_name, name) ModuleNotFoundError: No module named 'models_CC' 您好!具体报错如上 如果手动创建models_CC会发现:AttributeError: Can't get attribute 'LEVIR_CC_CaptionModel' on <module 'models_CC' (namespace)>

很抱歉!我之前放错了模型预训练权重的链接,正确的权重链接为:[MCI_model.pth] 之前的错误链接对应的模型是下面这篇文章的: [A Decoupling Paradigm With Prompt Learning for Remote Sensing Image Change Captioning]

RemGisNJU commented 1 month ago

Traceback (most recent call last): File "D:\NJU\RSIC\Multi_change\predict.py", line 239, in Change_Perception = Change_Perception() File "D:\NJU\RSIC\Multi_change\predict.py", line 101, in init checkpoint = torch.load(snapshot_full_path) File "D:\miniconda3\envs\Multi_change_env\lib\site-packages\torch\serialization.py", line 809, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "D:\miniconda3\envs\Multi_change_env\lib\site-packages\torch\serialization.py", line 1172, in _load result = unpickler.load() File "D:\miniconda3\envs\Multi_change_env\lib\site-packages\torch\serialization.py", line 1165, in find_class return super().find_class(mod_name, name) ModuleNotFoundError: No module named 'models_CC' 您好!具体报错如上 如果手动创建models_CC会发现:AttributeError: Can't get attribute 'LEVIR_CC_CaptionModel' on <module 'models_CC' (namespace)>

很抱歉!我之前放错了模型预训练权重的链接,正确的权重链接为:[MCI_model.pth] 之前的错误链接对应的模型是下面这篇文章的: [A Decoupling Paradigm With Prompt Learning for Remote Sensing Image Change Captioning]

好的,谢谢您!已经解决了