MotionGPT3
MotionGPT3 copied to clipboard
gen_mot_gpt: Failed to initialize NumPy: _ARRAY_API not found
$ python -m scripts.gen_mot_gpt
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.3.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.
If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.
Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/sadettin/Desktop/MotionGPT3/scripts/gen_mot_gpt.py", line 3, in <module>
from transformers import GPT2LMHeadModel
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/transformers/utils/import_utils.py", line 1782, in __getattr__
value = getattr(module, name)
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/transformers/utils/import_utils.py", line 1781, in __getattr__
module = self._get_module(self._class_to_module[name])
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/transformers/utils/import_utils.py", line 1793, in _get_module
return importlib.import_module("." + module_name, self.__name__)
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/transformers/models/gpt2/modeling_gpt2.py", line 31, in <module>
from ...generation import GenerationMixin
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/transformers/utils/import_utils.py", line 1781, in __getattr__
module = self._get_module(self._class_to_module[name])
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/transformers/utils/import_utils.py", line 1793, in _get_module
return importlib.import_module("." + module_name, self.__name__)
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/transformers/generation/utils.py", line 29, in <module>
from ..cache_utils import (
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/transformers/cache_utils.py", line 1872, in <module>
class OffloadedStaticCache(StaticCache):
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/transformers/cache_utils.py", line 1940, in OffloadedStaticCache
offload_device: Union[str, torch.device] = torch.device("cpu"),
/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/transformers/cache_utils.py:1940: UserWarning: Failed to initialize NumPy: _ARRAY_API not found (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:84.)
offload_device: Union[str, torch.device] = torch.device("cpu"),
Also
$ python app.py
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.2.6 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.
If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.
Traceback (most recent call last): File "/home/sadettin/Desktop/MotionGPT3/app.py", line 9, in <module>
import pytorch_lightning as pl
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/pytorch_lightning/__init__.py", line 26, in <module>
from pytorch_lightning.callbacks import Callback # noqa: E402
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/pytorch_lightning/callbacks/__init__.py", line 14, in <module>
from pytorch_lightning.callbacks.batch_size_finder import BatchSizeFinder
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/pytorch_lightning/callbacks/batch_size_finder.py", line 24, in <module>
from pytorch_lightning.callbacks.callback import Callback
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/pytorch_lightning/callbacks/callback.py", line 25, in <module>
from pytorch_lightning.utilities.types import STEP_OUTPUT
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/pytorch_lightning/utilities/types.py", line 25, in <module>
from torchmetrics import Metric
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/torchmetrics/__init__.py", line 14, in <module>
from torchmetrics import functional # noqa: E402
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/torchmetrics/functional/__init__.py", line 70, in <module>
from torchmetrics.functional.text.bleu import bleu_score
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/torchmetrics/functional/text/__init__.py", line 17, in <module>
from torchmetrics.functional.text.chrf import chrf_score # noqa: F401
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/torchmetrics/functional/text/chrf.py", line 43, in <module>
_EPS_SMOOTHING = tensor(1e-16)
/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/site-packages/torchmetrics/functional/text/chrf.py:43: UserWarning: Failed to initialize NumPy: _ARRAY_API not found (Triggered internally at ../torch/csrc/utils/tensor_numpy.cpp:84.)
_EPS_SMOOTHING = tensor(1e-16)
Global seed set to 1234
Traceback (most recent call last):
File "/home/sadettin/Desktop/MotionGPT3/app.py", line 35, in <module>
datamodule = build_data(cfg, phase="test")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sadettin/Desktop/MotionGPT3/motGPT/data/build_data.py", line 10, in build_data
return instantiate_from_config(data_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sadettin/Desktop/MotionGPT3/motGPT/config.py", line 42, in instantiate_from_config
return get_obj_from_str(config["target"])(**config.get("params", dict()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sadettin/Desktop/MotionGPT3/motGPT/config.py", line 33, in get_obj_from_str
return getattr(importlib.import_module(module, package=None), cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/sadettin/anaconda3/envs/mgpt/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/sadettin/Desktop/MotionGPT3/motGPT/data/webui.py", line 4, in <module>
from .humanml.scripts.motion_process import (process_file, recover_from_ric)
File "/home/sadettin/Desktop/MotionGPT3/motGPT/data/humanml/scripts/motion_process.py", line 26, in <module>
n_raw_offsets = torch.from_numpy(t2m_all_raw_offsets)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Numpy is not available
Thanks for raising this. The error appears to be caused by conflicting dependencies in the environment. You can try to "downgrade to 'numpy<2' or try to upgrade the affected module" .
For reference, here are some of the package versions from my environment:
python 3.11.11
numpy 1.26.0
numpy-base 1.26.4
pytorch-lightning 2.0.0
torch 2.0.0+cu118
torchaudio 2.0.1+cu118
torchdata 0.6.0
torchmetrics 0.7.0
torchtext 0.15.0
torchvision 0.15.1+cu118
torchmetrics 0.7.0