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

ImportError: cannot import name '_library_root_logger' from 'apex' (unknown location) #1803

Open
BBALU1660 opened this issue Jun 3, 2024 · 2 comments

Comments

@BBALU1660
Copy link

Error : Traceback (most recent call last):
File "/opt/NeMo/scripts/checkpoint_converters/convert_llama_hf_to_nemo.py", line 312, in
convert(args)
File "/opt/NeMo/scripts/checkpoint_converters/convert_llama_hf_to_nemo.py", line 288, in convert
model = load_state_dict_helper(MegatronGPTModel, nemo_config, trainer, checkpoint['state_dict'])
File "/opt/NeMo/nemo/collections/nlp/parts/utils_funcs.py", line 217, in load_state_dict_helper
model = cls(cfg, trainer)
File "/opt/NeMo/nemo/collections/nlp/models/language_modeling/megatron_gpt_model.py", line 287, in init
super().init(cfg, trainer=trainer, no_lm_init=True)
File "/opt/NeMo/nemo/collections/nlp/models/language_modeling/megatron_base_model.py", line 191, in init
initialize_model_parallel_for_nemo(
File "/opt/NeMo/nemo/collections/nlp/modules/common/megatron/megatron_init.py", line 159, in initialize_model_parallel_for_nemo
set_logging_level(apex_transformer_log_level)
File "/opt/apex/apex/transformer/log_util.py", line 16, in set_logging_level
from apex import _library_root_logger
ImportError: cannot import name '_library_root_logger' from 'apex' (unknown location)

command : python /opt/NeMo/scripts/checkpoint_converters/convert_llama_hf_to_nemo.py --input_name_or_path=./llama2-7b-hf/ --output_path=llama2-7b.nemo

Can anyone help me solve this

@arktoswb
Copy link

arktoswb commented Jun 4, 2024

I had the same issue. Reinstalling Apex helped: https://github.com/NVIDIA/NeMo?tab=readme-ov-file#apex

@JesusPaz
Copy link

JesusPaz commented Jun 6, 2024

Reinstall Apex works for me, thank you @arktoswb

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