Open CVKim opened 6 months ago
Could you please show me the whole error log?
E+00000.155: Error while enumerating installed packages.
Traceback (most recent call last):
File "/root/.vscode-server/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/common/log.py", line 361, in get_environment_description
report(" {0}=={1}\n", pkg.name, pkg.version)
AttributeError: 'PathDistribution' object has no attribute 'name'
Stack where logged:
File "/opt/conda/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/conda/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/root/.vscode-server/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/__main__.py", line 39, in <module>
cli.main()
File "/root/.vscode-server/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main
run()
File "/root/.vscode-server/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 281, in run_file
log.describe_environment("Pre-launch environment:")
File "/root/.vscode-server/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/common/log.py", line 369, in describe_environment
info("{0}", get_environment_description(header))
File "/root/.vscode-server/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/common/log.py", line 363, in get_environment_description
swallow_exception("Error while enumerating installed packages.")
File "/root/.vscode-server/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/common/log.py", line 215, in swallow_exception
_exception(format_string, *args, **kwargs)
Global seed set to 23 Loading model from /User/anomalydiffusion/models/ldm/text2img-large/model.ckpt Backend TkAgg is interactive backend. Turning interactive mode on. LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 872.30 M params. making attention of type 'vanilla' with 512 in_channels Working with z of shape (1, 4, 32, 32) = 4096 dimensions. making attention of type 'vanilla' with 512 in_channels Restored from /User/anomalydiffusion/models/ldm/text2img-large/model.ckpt with 0 missing and 2 unexpected keys Unexpected Keys: ['model_ema.decay', 'model_ema.num_updates']
It seems to be the mismatch version between imgaug and numpy. You can try installing imgaug=0.4.0
Exception has occurred: NameError
name 'trainer' is not defined
File "/User/anomalydiffusion/main.py", line 648, in
During handling of the above exception, another exception occurred:
File "/User/anomalydiffusion/main.py", line 891, in
I reinstalled it using pip install imgaug==0.4.0, but the same error occurred!
Then it may come from the version of numpy and python. Do you use python==3.8 and numpy==1.23.1?
numpy - 1.19.2 python - 3.8.5
I'm using it as above!
I'm having the same problem, along with ninja configuration issues (didn't think of a good solution), can the author give some advice?
python==3.8.5 numpy==1.23.1 imgaug==0.4.0
Global seed set to 23
Running on GPUs 0,
Loading model from models/ldm/text2img-large/model.ckpt
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 872.30 M params.
making attention of type 'vanilla' with 512 in_channels
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
making attention of type 'vanilla' with 512 in_channels
Restored from models/ldm/text2img-large/model.ckpt with 0 missing and 2 unexpected keys
Unexpected Keys: ['model_ema.decay', 'model_ema.num_updates']
Traceback (most recent call last):
File "main.py", line 645, in
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 888, in
I'm having the same problem, along with ninja configuration issues (didn't think of a good solution), can the author give some advice?
Environment:
python==3.8.5 numpy==1.23.1 imgaug==0.4.0
Error information:
Global seed set to 23 Running on GPUs 0, Loading model from models/ldm/text2img-large/model.ckpt LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 872.30 M params. making attention of type 'vanilla' with 512 in_channels Working with z of shape (1, 4, 32, 32) = 4096 dimensions. making attention of type 'vanilla' with 512 in_channels Restored from models/ldm/text2img-large/model.ckpt with 0 missing and 2 unexpected keys Unexpected Keys: ['model_ema.decay', 'model_ema.num_updates'] Traceback (most recent call last): File "main.py", line 645, in model = load_model_from_config(config, opt.actual_resume) File "main.py", line 30, in load_model_from_config model = instantiate_from_config(config.model) File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/util.py", line 85, in instantiate_from_config return get_obj_from_str(config["target"])(config.get("params", dict()), kwargs) File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/models/diffusion/ddpm.py", line 500, in init self.embedding_manager = self.instantiate_embedding_manager(personalization_config, self.cond_stage_model) File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/models/diffusion/ddpm.py", line 578, in instantiate_embedding_manager model = instantiate_from_config(config, embedder=embedder) File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/util.py", line 85, in instantiate_from_config return get_obj_from_str(config["target"])(config.get("params", dict()), kwargs) File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/util.py", line 93, in get_obj_from_str return getattr(importlib.import_module(module, package=None), cls) File "/home/xuyu/.conda/envs/Anomalydiffusion/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 783, in exec_module File "", line 219, in _call_with_frames_removed File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/modules/embedding_manager2.py", line 8, in from ldm.models.psp_encoder.encoders import psp_encoders File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/models/psp_encoder/encoders/psp_encoders.py", line 8, in from ..stylegan2.model import EqualLinear File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/models/psp_encoder/stylegan2/model.py", line 7, in from .op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/models/psp_encoder/stylegan2/op/init.py", line 1, in from .fused_act import FusedLeakyReLU, fused_leaky_relu File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/models/psp_encoder/stylegan2/op/fused_act.py", line 9, in fused = load( File "/home/xuyu/.conda/envs/Anomalydiffusion/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1202, in load return _jit_compile( File "/home/xuyu/.conda/envs/Anomalydiffusion/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1425, in _jit_compile _write_ninja_file_and_build_library( File "/home/xuyu/.conda/envs/Anomalydiffusion/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1506, in _write_ninja_file_and_build_library verify_ninja_availability() File "/home/xuyu/.conda/envs/Anomalydiffusion/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1562, in verify_ninja_availability raise RuntimeError("Ninja is required to load C++ extensions") RuntimeError: Ninja is required to load C++ extensions
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "main.py", line 888, in if trainer.global_rank == 0: NameError: name 'trainer' is not defined
i have the same problem
I'm having the same problem, along with ninja configuration issues (didn't think of a good solution), can the author give some advice?
Environment:
python==3.8.5 numpy==1.23.1 imgaug==0.4.0
Error information:
Global seed set to 23 Running on GPUs 0, Loading model from models/ldm/text2img-large/model.ckpt LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 872.30 M params. making attention of type 'vanilla' with 512 in_channels Working with z of shape (1, 4, 32, 32) = 4096 dimensions. making attention of type 'vanilla' with 512 in_channels Restored from models/ldm/text2img-large/model.ckpt with 0 missing and 2 unexpected keys Unexpected Keys: ['model_ema.decay', 'model_ema.num_updates'] Traceback (most recent call last): File "main.py", line 645, in model = load_model_from_config(config, opt.actual_resume) File "main.py", line 30, in load_model_from_config model = instantiate_from_config(config.model) File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/util.py", line 85, in instantiate_from_config return get_obj_from_str(config["target"])(config.get("params", dict()), kwargs) File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/models/diffusion/ddpm.py", line 500, in init self.embedding_manager = self.instantiate_embedding_manager(personalization_config, self.cond_stage_model) File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/models/diffusion/ddpm.py", line 578, in instantiate_embedding_manager model = instantiate_from_config(config, embedder=embedder) File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/util.py", line 85, in instantiate_from_config return get_obj_from_str(config["target"])(config.get("params", dict()), kwargs) File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/util.py", line 93, in get_obj_from_str return getattr(importlib.import_module(module, package=None), cls) File "/home/xuyu/.conda/envs/Anomalydiffusion/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 783, in exec_module File "", line 219, in _call_with_frames_removed File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/modules/embedding_manager2.py", line 8, in from ldm.models.psp_encoder.encoders import psp_encoders File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/models/psp_encoder/encoders/psp_encoders.py", line 8, in from ..stylegan2.model import EqualLinear File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/models/psp_encoder/stylegan2/model.py", line 7, in from .op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/models/psp_encoder/stylegan2/op/init.py", line 1, in from .fused_act import FusedLeakyReLU, fused_leaky_relu File "/home/xuyu/xuyu_model/AnomalyDiffusion/anomalydiffusion/ldm/models/psp_encoder/stylegan2/op/fused_act.py", line 9, in fused = load( File "/home/xuyu/.conda/envs/Anomalydiffusion/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1202, in load return _jit_compile( File "/home/xuyu/.conda/envs/Anomalydiffusion/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1425, in _jit_compile _write_ninja_file_and_build_library( File "/home/xuyu/.conda/envs/Anomalydiffusion/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1506, in _write_ninja_file_and_build_library verify_ninja_availability() File "/home/xuyu/.conda/envs/Anomalydiffusion/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1562, in verify_ninja_availability raise RuntimeError("Ninja is required to load C++ extensions") RuntimeError: Ninja is required to load C++ extensions During handling of the above exception, another exception occurred: Traceback (most recent call last): File "main.py", line 888, in if trainer.global_rank == 0: NameError: name 'trainer' is not defined
i have the same problem
It seems to be the lack of Ninja, you can just try installing Ninja.
Hiiii, after installing ninja, this error is reported, is it still necessary to configure the c++ related environment, such as installing VS and configuring environment variables?
Hiiii, after installing ninja, this error is reported, is it still necessary to configure the c++ related environment, such as installing VS and configuring environment variables?
Hi! The problem of Ninja is usually because of the Windows system. And you should also ensure the cuda version>10.0. To find how to install ninja on Windows, you can refer to https://github.com/rosinality/stylegan2-pytorch/issues/63 or https://github.com/rosinality/stylegan2-pytorch/issues/1.
Ok thanks, I'll try it first and see if I can fix it myself. ps:I tried it in ubuntu first as well and I also get some errors about ninja, I'm not familiar with c++ so I'm still struggling a bit~
Sorry, I really can't solve this ninja configuration problem (Win and Ubuntu environments), ubuntu final result is shown below, it seems to need cuda10.0 version and other conditions to run? Can the author follow up with a docker environment? Thank you for your time.
Sorry, I really can't solve this ninja configuration problem (Win and Ubuntu environments), ubuntu final result is shown below, it seems to need cuda10.0 version and other conditions to run? Can the author follow up with a docker environment? Thank you for your time.
I have encountered this problem in Ubuntu before and it comes from the mismatch version of cuda and gcc. You can follow my environment setting. cuda: 11.8 cudnn: 8 gcc: 7 Hope it works for you!
Hi! The above issue seems to have persisted after I installed Ninja using pip
你好!在我使用 pip 安装 Ninja 后,上述问题似乎仍然存在
你好,我的问题和你的相同,你有解决吗?
暂时解决了,我是这么处理的:
主要解决思路是保持conda内外部cuda版本的统一。 1、本机装了cuda11.8 + gcc 7.5。 2、在conda环境里装匹配cuda11.8的torch。
暂时解决了,我是这么处理的:
主要解决思路是保持conda内外部cuda版本的统一。 1、本机装了CUDA11.8 + GCC 7.5。 2、在conda环境里装匹配cuda11.8的torch。
谢谢,确实是gcc的问题
暂时解决了,我是这么处理的:
主要解决思路是保持conda内外部cuda版本的统一。 1、本机装了cuda11.8 + gcc 7.5。 2、在conda环境里装匹配cuda11.8的torch。
您好,我遇到了相同的问题,请问您安装的是那个pytorch和ninja版本呀?
你好!在我使用 pip 安装 Ninja 后,上述问题似乎仍然存在
你好,我的问题和你的相同,你有解决吗?
我虽然显示缺少了Unexpected key(s) in state_dict: "model_ema.decay", "model_ema.num_updates",但还是能正常运行但sample_scaled_gs和condition_gs是这样的图片正常吗?
The above error occurs, how can I solve it? It is expected to occur in the instantiate_from_config function, and the values that exist inside the model seem to be different.
model.ckpt
Error Log : Unexpected Keys: ['model_ema.decay', 'model_ema.num_updates']