Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行出现错误 #1

Open
CJLUHLL opened this issue Jul 23, 2024 · 3 comments
Open

运行出现错误 #1

CJLUHLL opened this issue Jul 23, 2024 · 3 comments

Comments

@CJLUHLL
Copy link

CJLUHLL commented Jul 23, 2024

Seed set to 2025
[2024-07-23 18:35:49,927][main][INFO] - [rank: 0] Instantiating datamodule <src.data.anomaly_clip_datamodule.AnomalyCLIPDataModule>
[2024-07-23 18:35:50,476][main][INFO] - [rank: 0] Instantiating model <src.models.anomaly_clip_module.AnomalyCLIPModule>
[2024-07-23 18:35:53,807][src.utils.utils][ERROR] - [rank: 0]
Traceback (most recent call last):
File "/home/find-jinglin/enter/envs/sowa/lib/python3.9/site-packages/hydra/_internal/utils.py", line 644, in _locate
obj = getattr(obj, part)
AttributeError: module 'src.models.components' has no attribute 'adapter'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/find-jinglin/enter/envs/sowa/lib/python3.9/site-packages/hydra/_internal/utils.py", line 650, in _locate
obj = import_module(mod)
File "/home/find-jinglin/enter/envs/sowa/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/home/find-jinglin/LLM-Model/model_file/sowa-main/src/models/components/adapter.py", line 9, in
from src.models.components.swin_transformer.swin_transformer_v2 import window_partition, window_reverse
ModuleNotFoundError: No module named 'src.models.components.swin_transformer'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/find-jinglin/enter/envs/sowa/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 134, in _resolve_target
target = _locate(target)
File "/home/find-jinglin/enter/envs/sowa/lib/python3.9/site-packages/hydra/_internal/utils.py", line 653, in _locate
raise ImportError(
ImportError: Error loading 'src.models.components.adapter.BasicLayer':
ModuleNotFoundError("No module named 'src.models.components.swin_transformer'")
Are you sure that 'adapter' is importable from module 'src.models.components'?

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/find-jinglin/LLM-Model/model_file/sowa-main/src/utils/utils.py", line 68, in wrap
metric_dict, object_dict = task_func(cfg=cfg)
File "/home/find-jinglin/LLM-Model/model_file/sowa-main/src/train.py", line 47, in train
model: LightningModule = hydra.utils.instantiate(cfg.model)
File "/home/find-jinglin/enter/envs/sowa/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 226, in instantiate
return instantiate_node(
File "/home/find-jinglin/enter/envs/sowa/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 342, in instantiate_node
value = instantiate_node(
File "/home/find-jinglin/enter/envs/sowa/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 342, in instantiate_node
value = instantiate_node(
File "/home/find-jinglin/enter/envs/sowa/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 333, in instantiate_node
target = _resolve_target(node.get(_Keys.TARGET), full_key)
File "/home/find-jinglin/enter/envs/sowa/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 139, in _resolve_target
raise InstantiationException(msg) from e
hydra.errors.InstantiationException: Error locating target 'src.models.components.adapter.BasicLayer', set env var HYDRA_FULL_ERROR=1 to see chained exception.
full_key: model.net.adapter
[2024-07-23 18:35:53,812][src.utils.utils][INFO] - [rank: 0] Output dir: /home/find-jinglin/LLM-Model/model_file/sowa-main/logs/train/runs/2024-07-23_18-35-49
Error executing job with overrides: ['trainer=gpu', 'data=sowa_visa', 'model=sowa_hfwa']
Error locating target 'src.models.components.adapter.BasicLayer', set env var HYDRA_FULL_ERROR=1 to see chained exception.
full_key: model.net.adapter

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

代码尝试导入 src.models.components.swin_transformer 模块,但未能找到它。这可能是因为路径设置不正确或模块文件不存在。

@huzongxiang
Copy link
Owner

感谢,已经修复了

@WangYQ999
Copy link

感谢,已经修复了

Is the training conducted on a 3070 GPU?

@huzongxiang
Copy link
Owner

huzongxiang commented Nov 15, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants