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
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
Simple recompilation of caffe2 solved issue: emerge sci-libs/caffe2