I am currently working on a project in TouchDesigner 2023.11880 that utilizes PyTorch, Transformers, and OpenCV. However, I am encountering an issue related to NumPy when running the code, and I’m hoping for some assistance.
The error message I receive is as follows:
td.tdError: C:\Program Files\Derivative\TouchDesigner.2023.11880\bin\Lib\site-packages\transformers\cache_utils.py:1879: 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”),
AttributeError: _ARRAY_API not found
ImportError: numpy.core.multiarray failed to import
It seems that there is an issue with importing numpy.core.multiarray
, possibly related to dependency conflicts between NumPy, PyTorch, and OpenCV.
Steps I’ve Tried:
- Reinstalling NumPy, PyTorch, and OpenCV: I’ve reinstalled these libraries in the internal Python environment of TouchDesigner.
- Downgrading NumPy: I attempted using older versions like
numpy==1.21.0
, but the issue persists. - Checking GPU Settings: I’ve ensured that TouchDesigner runs in either GPU or CPU mode, but it didn’t resolve the issue.
Environment:
- TouchDesigner 2023.11880
- Python 3.11 (built-in TouchDesigner environment)
- External libraries: NumPy, PyTorch, OpenCV, Transformers, etc.
If anyone has experience with this issue or can suggest a solution, I would greatly appreciate your help.
Thank you!