X-PLUG / mPLUG-Owl

mPLUG-Owl: The Powerful Multi-modal Large Language Model Family
https://www.modelscope.cn/studios/damo/mPLUG-Owl
MIT License
2.31k stars 176 forks source link

numpy is not available #234

Open ctxya1207 opened 2 months ago

ctxya1207 commented 2 months ago

(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 init2024-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 init2024-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 commented 2 months ago

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