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

numpy is not available #234

Open
ctxya1207 opened this issue Aug 16, 2024 · 4 comments
Open

numpy is not available #234

ctxya1207 opened this issue Aug 16, 2024 · 4 comments

Comments

@ctxya1207
Copy link

(mplug_owl2) E:\Project\Q-Instruct-main\mPLUG-Owl\mPLUG-Owl2>python -m mplug_owl2.serve.model_worker --host 0.0.0.0 --controller http://localhost:8006 --port 40000 --worker http://localhost:40000 --model-path C:\mplug-owl2-llama2-7b
2024-08-16 20:09:15 | INFO | model_worker | args: Namespace(host='0.0.0.0', port=40000, worker_address='http://localhost:40000', controller_address='http://localhost:8006', model_path='C:\mplug-owl2-llama2-7b', model_base=None, model_name=None, device='cuda', limit_model_concurrency=5, stream_interval=1, no_register=False, load_8bit=False, load_4bit=False)
2024-08-16 20:09:15 | INFO | model_worker | Loading the model C:\mplug-owl2-llama2-7b on worker 1b7dad ...
2024-08-16 20:09:15 | ERROR | stderr |
2024-08-16 20:09:15 | ERROR | stderr | A module that was compiled using NumPy 1.x cannot be run in
2024-08-16 20:09:15 | ERROR | stderr | NumPy 2.0.1 as it may crash. To support both 1.x and 2.x
2024-08-16 20:09:15 | ERROR | stderr | versions of NumPy, modules must be compiled with NumPy 2.0.
2024-08-16 20:09:15 | ERROR | stderr | Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.
2024-08-16 20:09:15 | ERROR | stderr |
2024-08-16 20:09:15 | ERROR | stderr | If you are a user of the module, the easiest solution will be to
2024-08-16 20:09:15 | ERROR | stderr | downgrade to 'numpy<2' or try to upgrade the affected module.
2024-08-16 20:09:15 | ERROR | stderr | We expect that some modules will need time to support NumPy 2.
2024-08-16 20:09:15 | ERROR | stderr |
2024-08-16 20:09:15 | ERROR | stderr | Traceback (most recent call last): File "E:\Anaconda\envs\mplug_owl2\lib\runpy.py", line 196, in _run_module_as_main
2024-08-16 20:09:15 | ERROR | stderr | return _run_code(code, main_globals, None,
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Anaconda\envs\mplug_owl2\lib\runpy.py", line 86, in _run_code
2024-08-16 20:09:15 | ERROR | stderr | exec(code, run_globals)
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Project\Q-Instruct-main\mPLUG-Owl\mPLUG-Owl2\mplug_owl2\serve\model_worker.py", line 268, in
2024-08-16 20:09:15 | ERROR | stderr | worker = ModelWorker(args.controller_address,
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Project\Q-Instruct-main\mPLUG-Owl\mPLUG-Owl2\mplug_owl2\serve\model_worker.py", line 65, in init
2024-08-16 20:09:15 | ERROR | stderr | self.tokenizer, self.model, self.image_processor, self.context_len = load_pretrained_model(
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Project\Q-Instruct-main\mPLUG-Owl\mPLUG-Owl2\mplug_owl2\model\builder.py", line 117, in load_pretrained_model
2024-08-16 20:09:15 | ERROR | stderr | model = AutoModelForCausalLM.from_pretrained(model_path, low_cpu_mem_usage=True, **kwargs)
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Anaconda\envs\mplug_owl2\lib\site-packages\transformers\models\auto\auto_factory.py", line 493, in from_pretrained
2024-08-16 20:09:15 | ERROR | stderr | return model_class.from_pretrained(
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Anaconda\envs\mplug_owl2\lib\site-packages\transformers\modeling_utils.py", line 2699, in from_pretrained
2024-08-16 20:09:15 | ERROR | stderr | with ContextManagers(init_contexts):
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Anaconda\envs\mplug_owl2\lib\site-packages\transformers\utils\generic.py", line 388, in enter
2024-08-16 20:09:15 | ERROR | stderr | self.stack.enter_context(context_manager)
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Anaconda\envs\mplug_owl2\lib\contextlib.py", line 492, in enter_context
2024-08-16 20:09:15 | ERROR | stderr | result = _cm_type.enter(cm)
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Anaconda\envs\mplug_owl2\lib\contextlib.py", line 135, in enter
2024-08-16 20:09:15 | ERROR | stderr | return next(self.gen)
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Anaconda\envs\mplug_owl2\lib\site-packages\accelerate\big_modeling.py", line 71, in init_empty_weights
2024-08-16 20:09:15 | ERROR | stderr | with init_on_device(torch.device("meta"), include_buffers=include_buffers) as f:
2024-08-16 20:09:15 | ERROR | stderr | E:\Anaconda\envs\mplug_owl2\lib\site-packages\accelerate\big_modeling.py:71: UserWarning: Failed to initialize NumPy: _ARRAY_API not found (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:84.)
2024-08-16 20:09:15 | ERROR | stderr | with init_on_device(torch.device("meta"), include_buffers=include_buffers) as f:
2024-08-16 20:09:15 | ERROR | stderr | Traceback (most recent call last):
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Anaconda\envs\mplug_owl2\lib\runpy.py", line 196, in _run_module_as_main
2024-08-16 20:09:15 | ERROR | stderr | return _run_code(code, main_globals, None,
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Anaconda\envs\mplug_owl2\lib\runpy.py", line 86, in _run_code
2024-08-16 20:09:15 | ERROR | stderr | exec(code, run_globals)
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Project\Q-Instruct-main\mPLUG-Owl\mPLUG-Owl2\mplug_owl2\serve\model_worker.py", line 268, in
2024-08-16 20:09:15 | ERROR | stderr | worker = ModelWorker(args.controller_address,
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Project\Q-Instruct-main\mPLUG-Owl\mPLUG-Owl2\mplug_owl2\serve\model_worker.py", line 65, in init
2024-08-16 20:09:15 | ERROR | stderr | self.tokenizer, self.model, self.image_processor, self.context_len = load_pretrained_model(
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Project\Q-Instruct-main\mPLUG-Owl\mPLUG-Owl2\mplug_owl2\model\builder.py", line 117, in load_pretrained_model
2024-08-16 20:09:15 | ERROR | stderr | model = AutoModelForCausalLM.from_pretrained(model_path, low_cpu_mem_usage=True, **kwargs)
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Anaconda\envs\mplug_owl2\lib\site-packages\transformers\models\auto\auto_factory.py", line 493, in from_pretrained
2024-08-16 20:09:15 | ERROR | stderr | return model_class.from_pretrained(
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Anaconda\envs\mplug_owl2\lib\site-packages\transformers\modeling_utils.py", line 2700, in from_pretrained
2024-08-16 20:09:15 | ERROR | stderr | model = cls(config, *model_args, **model_kwargs)
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Project\Q-Instruct-main\mPLUG-Owl\mPLUG-Owl2\mplug_owl2\model\modeling_mplug_owl2.py", line 218, in __init__2024-08-16 20:09:15 | ERROR | stderr | self.model = MPLUGOwl2LlamaModel(config)
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Project\Q-Instruct-main\mPLUG-Owl\mPLUG-Owl2\mplug_owl2\model\modeling_mplug_owl2.py", line 205, in __init__2024-08-16 20:09:15 | ERROR | stderr | super(MPLUGOwl2LlamaModel, self).init(config)
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Project\Q-Instruct-main\mPLUG-Owl\mPLUG-Owl2\mplug_owl2\model\modeling_mplug_owl2.py", line 39, in init
2024-08-16 20:09:15 | ERROR | stderr | self.visual_abstractor = MplugOwlVisualAbstractorModel(
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Project\Q-Instruct-main\mPLUG-Owl\mPLUG-Owl2\mplug_owl2\model\visual_encoder.py", line 785, in init
2024-08-16 20:09:15 | ERROR | stderr | self.encoder = MplugOwlVisualAbstractorEncoder(config)
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Project\Q-Instruct-main\mPLUG-Owl\mPLUG-Owl2\mplug_owl2\model\visual_encoder.py", line 721, in init
2024-08-16 20:09:15 | ERROR | stderr | [MplugOwlVisualAbstractorLayer(config, layer_idx) for layer_idx in range(config.num_hidden_layers)]
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Project\Q-Instruct-main\mPLUG-Owl\mPLUG-Owl2\mplug_owl2\model\visual_encoder.py", line 721, in
2024-08-16 20:09:15 | ERROR | stderr | [MplugOwlVisualAbstractorLayer(config, layer_idx) for layer_idx in range(config.num_hidden_layers)]
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Project\Q-Instruct-main\mPLUG-Owl\mPLUG-Owl2\mplug_owl2\model\visual_encoder.py", line 688, in init
2024-08-16 20:09:15 | ERROR | stderr | self.crossattention = MplugOwlVisualAbstractorAttention(config)
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Project\Q-Instruct-main\mPLUG-Owl\mPLUG-Owl2\mplug_owl2\model\visual_encoder.py", line 616, in init
2024-08-16 20:09:15 | ERROR | stderr | self.attention = MplugOwlVisualAbstractorMultiHeadAttention(config)
2024-08-16 20:09:15 | ERROR | stderr | File "E:\Project\Q-Instruct-main\mPLUG-Owl\mPLUG-Owl2\mplug_owl2\model\visual_encoder.py", line 512, in init
2024-08-16 20:09:15 | ERROR | stderr | torch.from_numpy(get_1d_sincos_pos_embed_from_grid(config.hidden_size, np.arange(config.num_learnable_queries, dtype=np.float32))).float()
2024-08-16 20:09:15 | ERROR | stderr | RuntimeError: Numpy is not available

@tunantu
Copy link

tunantu commented Aug 29, 2024

Hi, I used to meet the same issue. I try to modify the version of numpy, and then succeed. Here is the numpy version: 1.26.4

@snow-like-kk
Copy link

Hi, Can I ask for your version about flash-attn? I used CUDA11.7、torch 2.0.1, flash-attn 2.3.5, but flash-attn can't work successfully.

@tunantu
Copy link

tunantu commented Dec 2, 2024

Hi, Can I ask for your version about flash-attn? I used CUDA11.7、torch 2.0.1, flash-attn 2.3.5, but flash-attn can't work successfully.

Sorry for that. I created the envirinment followd by the official README step by step.... And I just use the inference procedure of this model, the flah-attn may have no effect to my experiment. So I didn't install flah-attn...

However, I met some relevant issue about flash-attn when finetuning LLaVA. Here is a flash-attn link may help you.
https://github.com/Dao-AILab/flash-attention/releases

Hope this could address your question.

@snow-like-kk
Copy link

Hi, Can I ask for your version about flash-attn? I used CUDA11.7、torch 2.0.1, flash-attn 2.3.5, but flash-attn can't work successfully.

Sorry for that. I created the envirinment followd by the official README step by step.... And I just use the inference procedure of this model, the flah-attn may have no effect to my experiment. So I didn't install flah-attn...

However, I met some relevant issue about flash-attn when finetuning LLaVA. Here is a flash-attn link may help you. https://github.com/Dao-AILab/flash-attention/releases

Hope this could address your question.

Thanks u so much!

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