Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Building (cross-compiling) dlib into amd64 container fails #3038

Open
AlbertoLopSie opened this issue Dec 11, 2024 · 5 comments
Open

Comments

@AlbertoLopSie
Copy link

What Operating System(s) are you seeing this problem on?

Linux (x86-64), macOS (Apple Silicon)

dlib version

19.24.1

Python version

3.12

Compiler

GNU C 12.2.0

Expected Behavior

It should build and install fine

Current Behavior

It fails when building docker container on Apple M1 using

docker buildx build --platform=linux/amd64 -t myimage .
facerecogsvc git:(main) ✗ docker buildx build --platform=linux/amd64 -t registry.gitlab.com/digicard/mldlcv/facerecogsvc-amd64 .
[+] Building 269.7s (9/16)                                                                                                                                                   docker-container:mybuilder
 => [internal] load build definition from Dockerfile                                                                                                                                               0.0s
 => => transferring dockerfile: 2.20kB                                                                                                                                                             0.0s
 => [internal] load metadata for docker.io/library/python:3.12-slim                                                                                                                                0.7s
 => [internal] load .dockerignore                                                                                                                                                                  0.0s
 => => transferring context: 2B                                                                                                                                                                    0.0s
 => [ 1/12] FROM docker.io/library/python:3.12-slim@sha256:2b0079146a74e23bf4ae8f6a28e1b484c6292f6fb904cbb51825b4a19812fcd8                                                                        0.0s
 => => resolve docker.io/library/python:3.12-slim@sha256:2b0079146a74e23bf4ae8f6a28e1b484c6292f6fb904cbb51825b4a19812fcd8                                                                          0.0s
 => [internal] load build context                                                                                                                                                                  0.0s
 => => transferring context: 9.59kB                                                                                                                                                                0.0s
 => CACHED [ 2/12] RUN apt-get update && apt-get install -y build-essential cmake                                                                                                                  0.0s
 => CACHED [ 3/12] RUN mkdir /app                                                                                                                                                                  0.0s
 => CACHED [ 4/12] WORKDIR /app                                                                                                                                                                    0.0s
 => ERROR [ 5/12] RUN pip install dlib                                                                                                                                                           268.8s
------
 > [ 5/12] RUN pip install dlib:
1.789 Collecting dlib
1.893   Downloading dlib-19.24.6.tar.gz (3.4 MB)
2.088      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.4/3.4 MB 20.9 MB/s eta 0:00:00
2.506   Installing build dependencies: started
4.436   Installing build dependencies: finished with status 'done'
4.438   Getting requirements to build wheel: started
4.828   Getting requirements to build wheel: finished with status 'done'
4.830   Preparing metadata (pyproject.toml): started
5.182   Preparing metadata (pyproject.toml): finished with status 'done'
5.185 Building wheels for collected packages: dlib
5.186   Building wheel for dlib (pyproject.toml): started
65.27   Building wheel for dlib (pyproject.toml): still running...
132.2   Building wheel for dlib (pyproject.toml): still running...
199.2   Building wheel for dlib (pyproject.toml): still running...
259.5   Building wheel for dlib (pyproject.toml): still running...
268.1   Building wheel for dlib (pyproject.toml): finished with status 'error'
268.2   error: subprocess-exited-with-error
268.2
268.2   × Building wheel for dlib (pyproject.toml) did not run successfully.
268.2   │ exit code: 1
268.2   ╰─> [617 lines of output]
268.2       <string>:234: SyntaxWarning: invalid escape sequence '\('
268.2       <string>:235: SyntaxWarning: invalid escape sequence '\('
268.2       <string>:236: SyntaxWarning: invalid escape sequence '\('
268.2       running bdist_wheel
268.2       running build
268.2       running build_ext
268.2       Building extension for Python 3.12.8 (main, Dec  4 2024, 20:39:59) [GCC 12.2.0]
268.2       Invoking CMake setup: 'cmake /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/build/lib.linux-x86_64-cpython-312 -DPYTHON_EXECUTABLE=/usr/local/bin/python3.12 -DDLIB_USE_FFMPEG=OFF -DCMAKE_BUILD_TYPE=Release'
268.2       -- The C compiler identification is GNU 12.2.0
268.2       -- The CXX compiler identification is GNU 12.2.0
268.2       -- Detecting C compiler ABI info
268.2       -- Detecting C compiler ABI info - done
268.2       -- Check for working C compiler: /usr/bin/cc - skipped
268.2       -- Detecting C compile features
268.2       -- Detecting C compile features - done
268.2       -- Detecting CXX compiler ABI info
268.2       -- Detecting CXX compiler ABI info - done
268.2       -- Check for working CXX compiler: /usr/bin/c++ - skipped
268.2       -- Detecting CXX compile features
268.2       -- Detecting CXX compile features - done
268.2       -- pybind11 v2.12.0
268.2       -- Found PythonInterp: /usr/local/bin/python3.12 (found suitable version "3.12.8", minimum required is "3.6")
268.2       -- Found PythonLibs: /usr/local/lib/libpython3.12.so
268.2       -- Performing Test HAS_FLTO
268.2       -- Performing Test HAS_FLTO - Success
268.2       -- Using CMake version: 3.25.1
268.2       -- Compiling dlib version: 19.24.6
268.2       -- SSE4 instructions can be executed by the host processor.
268.2       -- Enabling SSE4 instructions
268.2       -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
268.2       -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
268.2       -- Found Threads: TRUE
268.2       -- Could NOT find X11 (missing: X11_X11_INCLUDE_PATH X11_X11_LIB)
268.2        *****************************************************************************
268.2        *** DLIB GUI SUPPORT DISABLED BECAUSE X11 DEVELOPMENT LIBRARIES NOT FOUND ***
268.2        *** Make sure libx11-dev is installed if you want GUI support.            ***
268.2        *** On Ubuntu run: sudo apt-get install libx11-dev                        ***
268.2        *****************************************************************************
268.2       -- Searching for JPEG XL
268.2       -- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
268.2       -- PkgConfig could not be found, JPEG XL support won't be available
268.2       -- Searching for BLAS and LAPACK
268.2       -- Searching for BLAS and LAPACK
268.2       -- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
268.2       -- Looking for cblas_ddot
268.2       -- Looking for cblas_ddot - not found
268.2       -- Looking for sys/types.h
268.2       -- Looking for sys/types.h - found
268.2       -- Looking for stdint.h
268.2       -- Looking for stdint.h - found
268.2       -- Looking for stddef.h
268.2       -- Looking for stddef.h - found
268.2       -- Check size of void*
268.2       -- Check size of void* - done
268.2        *****************************************************************************
268.2        *** No BLAS library found so using dlib's built in BLAS.  However, if you ***
268.2        *** install an optimized BLAS such as OpenBLAS or the Intel MKL your code ***
268.2        *** will run faster.  On Ubuntu you can install OpenBLAS by executing:    ***
268.2        ***    sudo apt-get install libopenblas-dev liblapack-dev                 ***
268.2        *** Or you can easily install OpenBLAS from source by downloading the     ***
268.2        *** source tar file from http://www.openblas.net, extracting it, and      ***
268.2        *** running:                                                              ***
268.2        ***    make; sudo make install                                            ***
268.2        *****************************************************************************
268.2       CUDA_TOOLKIT_ROOT_DIR not found or specified
268.2       -- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "7.5")
268.2       -- Found CUDA, but CMake was unable to find the cuBLAS libraries that should be part of every basic CUDA install. Your CUDA install is somehow broken or incomplete. Since cuBLAS is required for dlib to use CUDA we won't use CUDA.
268.2       -- DID NOT FIND CUDA
268.2       -- Disabling CUDA support for dlib.  DLIB WILL NOT USE CUDA
268.2       -- Configuring done
268.2       -- Generating done
268.2       -- Build files have been written to: /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/build/temp.linux-x86_64-cpython-312
268.2       Invoking CMake build: 'cmake --build . --config Release -- -j4'
268.2       [  1%] Building CXX object dlib_build/CMakeFiles/dlib.dir/base64/base64_kernel_1.cpp.o
268.2       [  1%] Building CXX object dlib_build/CMakeFiles/dlib.dir/bigint/bigint_kernel_1.cpp.o
...
268.2       [ 98%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/global_optimization.cpp.o
268.2       [ 98%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/image_dataset_metadata.cpp.o
268.2       [ 99%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/numpy_returns.cpp.o
268.2       [ 99%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/line.cpp.o
268.2       [100%] Linking CXX shared module /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/build/lib.linux-x86_64-cpython-312/_dlib_pybind11.cpython-312-x86_64-linux-gnu.so
268.2       make[3]: *** write jobserver: Bad file descriptor.  Stop.
268.2       make[3]: *** Waiting for unfinished jobs....
268.2       make[3]: *** write jobserver: Bad file descriptor.  Stop.
268.2       lto-wrapper: fatal error: make returned 2 exit status
268.2       compilation terminated.
268.2       /usr/bin/ld: error: lto-wrapper failed
268.2       collect2: error: ld returned 1 exit status
268.2       gmake[2]: *** [CMakeFiles/_dlib_pybind11.dir/build.make:482: /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/build/lib.linux-x86_64-cpython-312/_dlib_pybind11.cpython-312-x86_64-linux-gnu.so] Error 1
268.2       gmake[1]: *** [CMakeFiles/Makefile2:118: CMakeFiles/_dlib_pybind11.dir/all] Error 2
268.2       gmake: *** [Makefile:91: all] Error 2
268.2       Traceback (most recent call last):
268.2         File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
268.2           main()
268.2         File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
268.2           json_out['return_val'] = hook(**hook_input['kwargs'])
268.2                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
268.2         File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
268.2           return _build_backend().build_wheel(wheel_directory, config_settings,
268.2                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
268.2         File "/tmp/pip-build-env-bxn3aff6/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 438, in build_wheel
268.2           return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)])
268.2                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
268.2         File "/tmp/pip-build-env-bxn3aff6/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 426, in _build
268.2           return self._build_with_temp_dir(
268.2                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
268.2         File "/tmp/pip-build-env-bxn3aff6/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir
268.2           self.run_setup()
268.2         File "/tmp/pip-build-env-bxn3aff6/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 522, in run_setup
268.2           super().run_setup(setup_script=setup_script)
268.2         File "/tmp/pip-build-env-bxn3aff6/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 320, in run_setup
268.2           exec(code, locals())
268.2         File "<string>", line 243, in <module>
268.2         File "/tmp/pip-build-env-bxn3aff6/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 117, in setup
268.2           return distutils.core.setup(**attrs)
268.2                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
268.2         File "/tmp/pip-build-env-bxn3aff6/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 183, in setup
268.2           return run_commands(dist)
268.2                  ^^^^^^^^^^^^^^^^^^
268.2         File "/tmp/pip-build-env-bxn3aff6/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 199, in run_commands
268.2           dist.run_commands()
268.2         File "/tmp/pip-build-env-bxn3aff6/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
268.2           self.run_command(cmd)
268.2         File "/tmp/pip-build-env-bxn3aff6/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 995, in run_command
268.2           super().run_command(command)
268.2         File "/tmp/pip-build-env-bxn3aff6/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
268.2           cmd_obj.run()
268.2         File "/tmp/pip-build-env-bxn3aff6/overlay/lib/python3.12/site-packages/setuptools/command/bdist_wheel.py", line 381, in run
268.2           self.run_command("build")
268.2         File "/tmp/pip-build-env-bxn3aff6/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
268.2           self.distribution.run_command(command)
268.2         File "/tmp/pip-build-env-bxn3aff6/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 995, in run_command
268.2           super().run_command(command)
268.2         File "/tmp/pip-build-env-bxn3aff6/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
268.2           cmd_obj.run()
268.2         File "/tmp/pip-build-env-bxn3aff6/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/build.py", line 135, in run
268.2           self.run_command(cmd_name)
268.2         File "/tmp/pip-build-env-bxn3aff6/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
268.2           self.distribution.run_command(command)
268.2         File "/tmp/pip-build-env-bxn3aff6/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 995, in run_command
268.2           super().run_command(command)
268.2         File "/tmp/pip-build-env-bxn3aff6/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
268.2           cmd_obj.run()
268.2         File "<string>", line 168, in run
268.2         File "<string>", line 209, in build_extension
268.2         File "/usr/local/lib/python3.12/subprocess.py", line 413, in check_call
268.2           raise CalledProcessError(retcode, cmd)
268.2       subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j4']' returned non-zero exit status 2.
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59,
268.2           inlined from ‘resize’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:654:30,
268.2           inlined from ‘__ct ’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:121:19,
268.2           inlined from ‘extract_image_chips.constprop.isra’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/image_transforms/interpolation.h:1882:79:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In function ‘extract_image_chips.constprop.isra’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size.constprop’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In member function ‘set_max_size.constprop’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size.constprop’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In member function ‘set_max_size.constprop’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size.constprop’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In member function ‘set_max_size.constprop’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59,
268.2           inlined from ‘resize’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:654:30,
268.2           inlined from ‘__ct ’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:121:19,
268.2           inlined from ‘extract_image_chips.constprop.isra’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/image_transforms/interpolation.h:1882:79:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In function ‘extract_image_chips.constprop.isra’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59,
268.2           inlined from ‘initialize_scanners’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/svm/structural_svm_object_detection_problem.h:499:34,
268.2           inlined from ‘__ct ’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/svm/structural_svm_object_detection_problem.h:94:32,
268.2           inlined from ‘train_impl’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/svm/structural_object_detection_trainer.h:371:17,
268.2           inlined from ‘train’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/svm/structural_object_detection_trainer.h:327:80,
268.2           inlined from ‘train_simple_object_detector_on_images’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/tools/python/src/simple_object_detector.h:225:32,
268.2           inlined from ‘train_simple_object_detector’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/tools/python/src/simple_object_detector.h:260:133:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In function ‘train_simple_object_detector’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In member function ‘set_max_size’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size.constprop’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In member function ‘set_max_size.constprop’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/matrix_data_layout.h:335:43,
268.2           inlined from ‘__ct ’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/matrix.h:1127:26,
268.2           inlined from ‘__ct ’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/svm/function.h:55:13,
268.2           inlined from ‘do_train’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/svm/svm_c_trainer.h:262:87:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In member function ‘do_train’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59,
268.2           inlined from ‘deserialize’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:273:30,
268.2           inlined from ‘deserialize’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:276:28,
268.2           inlined from ‘deserialize’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/image_processing/../image_processing/scan_fhog_pyramid.h:502:20:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In function ‘deserialize’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/matrix_data_layout.h:335:43,
268.2           inlined from ‘set_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/matrix.h:1440:34,
268.2           inlined from ‘do_train’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/svm/svm_c_trainer.h:247:37:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In member function ‘do_train’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59,
268.2           inlined from ‘push_back.constprop’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:769:30:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In member function ‘push_back.constprop’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59,
268.2           inlined from ‘push_back.constprop’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:769:30:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In member function ‘push_back.constprop’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/matrix_data_layout.h:335:43,
268.2           inlined from ‘set_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/matrix.h:1440:34,
268.2           inlined from ‘do_train’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/svm/svm_c_trainer.h:247:37:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In member function ‘do_train’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59,
268.2           inlined from ‘resize’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:654:30,
268.2           inlined from ‘__ct ’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:121:19,
268.2           inlined from ‘extract_image_chips.constprop.isra’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/image_transforms/interpolation.h:1882:79:
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/matrix_data_layout.h:335:43,
268.2           inlined from ‘set_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/matrix.h:1440:34,
268.2           inlined from ‘do_train’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/svm/svm_c_trainer.h:247:37:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In member function ‘do_train’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In function ‘extract_image_chips.constprop.isra’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In member function ‘set_max_size’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size.constprop’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In member function ‘set_max_size.constprop’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size.constprop’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In member function ‘set_max_size.constprop’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size.constprop’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In member function ‘set_max_size.constprop’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/matrix_data_layout.h:335:43,
268.2           inlined from ‘__ct ’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/matrix.h:1127:26,
268.2           inlined from ‘__ct ’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/svm/function.h:55:13,
268.2           inlined from ‘do_train’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/svm/svm_c_trainer.h:262:87:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In member function ‘do_train’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59,
268.2           inlined from ‘resize’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:654:30,
268.2           inlined from ‘__ct ’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:121:19,
268.2           inlined from ‘extract_image_chips.constprop.isra’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/image_transforms/interpolation.h:1882:79:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In function ‘extract_image_chips.constprop.isra’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/matrix_data_layout.h:335:43,
268.2           inlined from ‘set_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/matrix.h:1440:34,
268.2           inlined from ‘do_train’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/svm/svm_c_trainer.h:247:37:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In member function ‘do_train’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59,
268.2           inlined from ‘resize’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:654:30,
268.2           inlined from ‘__ct ’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:121:19,
268.2           inlined from ‘extract_image_chips.constprop.isra’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/image_transforms/interpolation.h:1882:79:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In function ‘extract_image_chips.constprop.isra’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59,
268.2           inlined from ‘resize’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:654:30,
268.2           inlined from ‘__ct ’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:121:19,
268.2           inlined from ‘extract_image_chips.constprop.isra’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/image_transforms/interpolation.h:1882:79:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In function ‘extract_image_chips.constprop.isra’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59,
268.2           inlined from ‘push_back’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:769:30,
268.2           inlined from ‘push_back’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:794:18,
268.2           inlined from ‘add_image_left_right_flips’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/image_processing/../image_processing/../image_transforms/interpolation.h:1208:29,
268.2           inlined from ‘train_simple_object_detector_on_images.constprop’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/tools/python/src/simple_object_detector.h:223:39:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In function ‘train_simple_object_detector_on_images.constprop’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59,
268.2           inlined from ‘initialize_scanners’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/svm/structural_svm_object_detection_problem.h:499:34,
268.2           inlined from ‘__ct ’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/svm/structural_svm_object_detection_problem.h:94:32,
268.2           inlined from ‘train_impl’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/svm/structural_object_detection_trainer.h:371:17,
268.2           inlined from ‘train’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/svm/structural_object_detection_trainer.h:327:80,
268.2           inlined from ‘train_simple_object_detector_on_images.constprop’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/tools/python/src/simple_object_detector.h:225:32:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In function ‘train_simple_object_detector_on_images.constprop’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59,
268.2           inlined from ‘resize’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:654:30,
268.2           inlined from ‘__ct ’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:121:19,
268.2           inlined from ‘extract_image_chips.constprop.isra’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/image_transforms/interpolation.h:1882:79:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In function ‘extract_image_chips.constprop.isra’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       In member function ‘allocate_array’,
268.2           inlined from ‘set_max_size’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:438:59,
268.2           inlined from ‘resize’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:654:30,
268.2           inlined from ‘__ct ’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/matrix/../array/array_kernel.h:121:19,
268.2           inlined from ‘extract_image_chips.constprop.isra’ at /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/image_transforms/interpolation.h:1882:79:
268.2       /tmp/pip-install-qduxqlts/dlib_cd96a1845678482a977c19680cedfa9e/dlib/../dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h:54:24: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
268.2          54 |                 return new T[size];
268.2             |                        ^
268.2       /usr/include/c++/12/new: In function ‘extract_image_chips.constprop.isra’:
268.2       /usr/include/c++/12/new:128:26: note: in a call to allocation function ‘operator new []’ declared here
268.2         128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
268.2             |                          ^
268.2       [end of output]
268.2
268.2   note: This error originates from a subprocess, and is likely not a problem with pip.
268.2   ERROR: Failed building wheel for dlib
268.2 Failed to build dlib
268.5 ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (dlib)
------
WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
Dockerfile:40
--------------------
  38 |     # RUN pip install cmake
  39 |     # RUN pip install dlib==19.24.4
  40 | >>> RUN pip install dlib
  41 |
  42 |     # install remaining dependencies
--------------------
ERROR: failed to solve: process "/bin/sh -c pip install dlib" did not complete successfully: exit code: 1

Steps to Reproduce

Place:

FROM python:3.12-slim
RUN apt-get update && apt-get install -y build-essential cmake
RUN pip install dlib

into a Dockerfile and run:

docker buildx build --platform=linux/amd64 -t myimage .

Anything else?

It builds ok on linux/arm64 or Apple M1 platforms

@AlbertoLopSie AlbertoLopSie changed the title [Bug]: dfsdf [Bug]: Building (cross-compiling) dlib into amd64 container fails Dec 11, 2024
@AlbertoLopSie
Copy link
Author

Update:

Changing install command to RUN LDFLAGS=-fno-lto pip install dlib makes the build proceed.

But the test program fails on start with:

Traceback (most recent call last):
  File "/app/frapi-start.py", line 14, in <module>
    import FRAPI_impl
  File "/app/FRAPI_impl.py", line 18, in <module>
    import face_recognition
  File "/usr/local/lib/python3.12/site-packages/face_recognition/__init__.py", line 7, in <module>
    from .api import load_image_file, face_locations, batch_face_locations, face_landmarks, face_encodings, compare_faces, face_distance
  File "/usr/local/lib/python3.12/site-packages/face_recognition/api.py", line 4, in <module>
    import dlib
  File "/usr/local/lib/python3.12/site-packages/dlib/__init__.py", line 19, in <module>
    from _dlib_pybind11 import *
ImportError: dynamic module does not define module export function (PyInit__dlib_pybind11)

The same error is produced in linux/amd64 and linux/arm64 platforms

@davisking
Copy link
Owner

Cool. Can you send me a PR that makes it work for you? :)

@AlbertoLopSie
Copy link
Author

AlbertoLopSie commented Dec 16, 2024

No Davis, it didn't work. It builds ok but fails in run.

The only way I was able to build the package was building it with clang. With both gnuc 10 and 12 the build fails.

It appears to be a problem related to LTO (A link optimization technique) bug either on dlib or pybind11.

I couldn't invest more time researching. Building with clang did the trick to me.

Hope it helps you to find the fix.

@davisking
Copy link
Owner

That Bad file descriptor makes it sound like your computer just ran out of file descriptors. Maybe you have your descriptor limit set unusually low (e.g. do ulimit -n 10000 to increase it).

@AlbertoLopSie
Copy link
Author

That Bad file descriptor makes it sound like your computer just ran out of file descriptors. Maybe you have your descriptor limit set unusually low (e.g. do ulimit -n 10000 to increase it).

It must be a linux-in-docker setting... I'll try your suggestion and post results here.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants