Skip to content

[BUG] birefnet ShapeInferenceError #790

@Aloento

Description

@Aloento

Describe the bug
A clear and concise description of what the bug is.

$ pip install rembg[cpu] --force-reinstall

Successfully installed attrs-25.3.0 certifi-2025.8.3 charset_normalizer-3.4.3 coloredlogs-15.0.1 flatbuffers-25.9.23 humanfriendly-10.0 idna-3.10 imageio-2.37.0 jsonschema-4.25.1 jsonschema-specifications-2025.9.1 lazy-loader-0.4 llvmlite-0.45.1 mpmath-1.3.0 networkx-3.4.2 numba-0.62.1 numpy-2.2.6 onnxruntime-1.23.0 opencv-python-headless-4.12.0.88 packaging-25.0 pillow-11.3.0 platformdirs-4.4.0 pooch-1.8.2 protobuf-6.32.1 pymatting-1.1.14 referencing-0.36.2 rembg-2.0.67 requests-2.32.5 rpds-py-0.27.1 scikit-image-0.25.2 scipy-1.15.3 sympy-1.14.0 tifffile-2025.5.10 tqdm-4.67.1 typing-extensions-4.15.0 urllib3-2.5.0

$ python -m preprocess

2025-10-03 16:02:42.045306708 [W:onnxruntime:Default, device_discovery.cc:164 DiscoverDevicesForPlatform] GPU device discovery failed: device_discovery.cc:89 ReadFileContents Failed to open file: "/sys/class/drm/card0/device/vendor"
birefnet-general
[ONNXRuntimeError] : 1 : FAIL : Node (/decoder/Split_33) Op (Split) [ShapeInferenceError] Cannot parse data from external tensors. Please load external data into raw data for tensor: /decoder/Constant_1066_output_0

To Reproduce
Steps to reproduce the behavior:

python 3.10.12

rembg_session = rembg.new_session("birefnet-general")

OS Version:
6.8.0-65-generic #68~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 15 18:06:34 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Rembg version:
v2.0.67

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions