Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 938540 - PyTorch - Caffe2 - UserWarning: Failed to initialize NumPy 2
Summary: PyTorch - Caffe2 - UserWarning: Failed to initialize NumPy 2
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal minor
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-27 00:39 UTC by Vit
Modified: 2024-08-27 09:07 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vit 2024-08-27 00:39:08 UTC
Triggered By code: "return torch.tensor(value)". From huggingface transformers/tokenization_utils_base.py

UserWarning: Failed to initialize NumPy:                                                      A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.1 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.                  
                    
 (Triggered internally at /var/tmp/portage/sci-libs/caffe2-2.3.1/work/pytorch-2.
3.1/torch/csrc/utils/tensor_numpy.cpp:84.)

Reproducible: Always




emerge -pv pytorch

[ebuild   R   ~] sci-libs/pytorch-2.3.1::anonch  USE="-debug" PYTHON_SINGLE_TARGET="python3_12 -python3_10 -python3_11" 0 KiB

emerge -pv numpy

[ebuild   R    ] dev-python/numpy-2.0.1:0/2::gentoo  USE="-debug -lapack -test" PYTHON_TARGETS="python3_12 (-pypy3) -python3_10 -python3_11 (-python3_13)" 0 KiB
Comment 1 Vit 2024-08-27 00:45:03 UTC
emerge -pv sci-libs/caffe2

[ebuild   R   ~] sci-libs/caffe2-2.3.1::gentoo  USE="numpy opencl openmp -cuda -distributed -fbgemm -ffmpeg -flash -gloo -mkl -mpi -nnpack -onednn -openblas -opencv -qnnpack -rocm -xnnpack" AMDGPU_TARGETS="gfx90a gfx906 gfx908 gfx942 gfx1030 gfx1100 -gfx803 -gfx900 -gfx940 -gfx941 -gfx1010 -gfx1011 -gfx1012 -gfx1031 -gfx1101 -gfx1102" PYTHON_SINGLE_TARGET="python3_12 -python3_10 -python3_11" 0 KiB
Comment 2 Vit 2024-08-27 08:52:25 UTC
Simple recompilation of caffe2 solved issue:

emerge sci-libs/caffe2