ImportError: numpy.core.multiarray failed to import

I am trying Running TAO Toolkit on Google Colab.

Here is the link:

When I run the command below, it get this output

Using TensorFlow backend.
2024-08-22 06:31:05,003 [TAO Toolkit] [WARNING] tensorflow 40: Deprecation warnings have been disabled. Set TF_ENABLE_DEPRECATION_WARNINGS=1 to re-enable them.
2024-08-22 06:31:06,159 [TAO Toolkit] [WARNING] root 329: Limited tf.compat.v2.summary API due to missing TensorBoard installation.
2024-08-22 06:31:06,795 [TAO Toolkit] [WARNING] root 329: Limited tf.compat.v2.summary API due to missing TensorBoard installation.
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf
Traceback (most recent call last):
File “/usr/local/bin/yolo_v4_tiny”, line 8, in
sys.exit(main())
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v4/entrypoint/yolo_v4.py”, line 12, in main
launch_job(nvidia_tao_tf1.cv.yolo_v4.scripts, “yolo_v4”, sys.argv[1:])
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/common/entrypoint/entrypoint.py”, line 276, in launch_job
modules = get_modules(package)
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/common/entrypoint/entrypoint.py”, line 47, in get_modules
module = importlib.import_module(module_name)
File “/usr/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 843, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v4/scripts/train.py”, line 31, in
from nvidia_tao_tf1.cv.yolo_v4.models.utils import build_training_pipeline
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v4/models/utils.py”, line 13, in
from nvidia_tao_tf1.cv.yolo_v4.models.yolov4_model import YOLOv4Model
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v4/models/yolov4_model.py”, line 27, in
from nvidia_tao_tf1.cv.common.evaluator.ap_evaluator import APEvaluator
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/common/evaluator/ap_evaluator.py”, line 25, in
from matplotlib import pyplot as plt
File “/usr/local/lib/python3.8/dist-packages/matplotlib/pyplot.py”, line 32, in
import matplotlib.colorbar
File “/usr/local/lib/python3.8/dist-packages/matplotlib/colorbar.py”, line 28, in
import matplotlib.artist as martist
File “/usr/local/lib/python3.8/dist-packages/matplotlib/artist.py”, line 11, in
from .path import Path
File “/usr/local/lib/python3.8/dist-packages/matplotlib/path.py”, line 17, in
from . import _path, rcParams
ImportError: numpy.core.multiarray failed to import

Could you please check the numpy version?
! tao model yolo_v4_tiny run /bin/bash

then colab will give you an interactive environment.
You can check the version.

import numpy as np 
print np.__version__ 

image
Here is the version

According to nvidia-tao/tensorflow/requirements-pip.txt at 5c9a6b052aca0cee7cb8b10d6db7bb91e463e6fb · NVIDIA-AI-IOT/nvidia-tao · GitHub, could you install numpy==1.22.2 to check if it works?

! tao model yolo_v4_tiny run /bin/bash
then install numpy==1.22.2,
then run yolo_v4_tiny dataset_convert xxx directly here.

I found the different result when I use the command below

after that, I run the python code
image

and I run the command again.

the error log is like
Using TensorFlow backend.
2024-08-29 03:26:48,139 [TAO Toolkit] [WARNING] tensorflow 40: Deprecation warnings have been disabled. Set TF_ENABLE_DEPRECATION_WARNINGS=1 to re-enable them.
2024-08-29 03:26:49,401 [TAO Toolkit] [WARNING] root 329: Limited tf.compat.v2.summary API due to missing TensorBoard installation.
2024-08-29 03:26:50,082 [TAO Toolkit] [WARNING] root 329: Limited tf.compat.v2.summary API due to missing TensorBoard installation.
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf
Traceback (most recent call last):
File “/usr/local/bin/yolo_v4_tiny”, line 8, in
sys.exit(main())
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v4/entrypoint/yolo_v4.py”, line 12, in main
launch_job(nvidia_tao_tf1.cv.yolo_v4.scripts, “yolo_v4”, sys.argv[1:])
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/common/entrypoint/entrypoint.py”, line 276, in launch_job
modules = get_modules(package)
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/common/entrypoint/entrypoint.py”, line 47, in get_modules
module = importlib.import_module(module_name)
File “/usr/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 843, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v4/scripts/train.py”, line 31, in
from nvidia_tao_tf1.cv.yolo_v4.models.utils import build_training_pipeline
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v4/models/utils.py”, line 13, in
from nvidia_tao_tf1.cv.yolo_v4.models.yolov4_model import YOLOv4Model
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v4/models/yolov4_model.py”, line 27, in
from nvidia_tao_tf1.cv.common.evaluator.ap_evaluator import APEvaluator
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/common/evaluator/ap_evaluator.py”, line 25, in
from matplotlib import pyplot as plt
File “/usr/local/lib/python3.8/dist-packages/matplotlib/pyplot.py”, line 32, in
import matplotlib.colorbar
File “/usr/local/lib/python3.8/dist-packages/matplotlib/colorbar.py”, line 28, in
import matplotlib.artist as martist
File “/usr/local/lib/python3.8/dist-packages/matplotlib/artist.py”, line 11, in
from .path import Path
File “/usr/local/lib/python3.8/dist-packages/matplotlib/path.py”, line 17, in
from . import _path, rcParams
ImportError: numpy.core.multiarray failed to import

If there is a solution, please kindly reply. Thank you

Sorry for late reply. Could you update the numpy version after running into the interactive mode! tao model yolo_v4_tiny run /bin/bash
Similar to python - ImportError: numpy.core.multiarray failed to import - Stack Overflow.
I will check further as well.

The update for numpy version is not working. Internal team will check further. I will give you update if you have.

Please rerun the colab. There is already a fix against the numpy. More info can be found in [BUGFIX] Fix multiple numpy installation · NVIDIA-AI-IOT/nvidia-tao@fbf4955 · GitHub.