Skip to content

Tensor.item() cannot be called on meta tensors #101

@doubleLife-666

Description

@doubleLife-666

When I run app.py, this error occurs. What should I do?

File "/projects/github_project/TRELLIS.2/app.py", line 633, in
pipeline = Trellis2ImageTo3DPipeline.from_pretrained('/projects/github_project/TRELLIS.2/models/TRELLIS.2-4B')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/projects/github_project/TRELLIS.2/trellis2/pipelines/trellis2_image_to_3d.py", line 105, in from_pretrained
pipeline.rembg_model = getattr(rembg, args['rembg_model']['name'])(**args['rembg_model']['args'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/projects/github_project/TRELLIS.2/trellis2/pipelines/rembg/BiRefNet.py", line 11, in init
self.model = AutoModelForImageSegmentation.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/projects/github_project/TRELLIS.2/.venv/lib/python3.12/site-packages/transformers/models/auto/auto_factory.py", line 365, in from_pretrained
return model_class.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/projects/github_project/TRELLIS.2/.venv/lib/python3.12/site-packages/transformers/modeling_utils.py", line 4072, in from_pretrained
model = cls(config, *model_args, **model_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jiuzhang/.cache/huggingface/modules/transformers_modules/briaai/birefnet.py", line 1986, in init
self.bb = build_backbone(self.config.bb, pretrained=bb_pretrained)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jiuzhang/.cache/huggingface/modules/transformers_modules/briaai/birefnet.py", line 1405, in build_backbone
bb = eval('{}({})'.format(bb_name, params_settings))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1, in
File "/home/jiuzhang/.cache/huggingface/modules/transformers_modules/briaai/birefnet.py", line 1224, in swin_v1_l
model = SwinTransformer(embed_dim=192, depths=[2, 2, 18, 2], num_heads=[6, 12, 24, 48], window_size=12)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jiuzhang/.cache/huggingface/modules/transformers_modules/briaai/birefnet.py", line 1131, in init
dpr = [x.item() for x in torch.linspace(0, drop_path_rate, sum(depths))] # stochastic depth decay rule
^^^^^^^^
File "/projects/github_project/TRELLIS.2/.venv/lib/python3.12/site-packages/torch/utils/_device.py", line 104, in torch_function
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/projects/github_project/TRELLIS.2/.venv/lib/python3.12/site-packages/torch/_meta_registrations.py", line 6585, in meta_local_scalar_dense
raise RuntimeError("Tensor.item() cannot be called on meta tensors")
RuntimeError: Tensor.item() cannot be called on meta tensors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions