RuntimeError: max(): Expected reduction dim to be specified for input.numel() == 0. Specify the reduction dim with the 'dim' argument.
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 13.7k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
It seems that there is something wrong with coords
D:\TRELLIS_env\Scripts\python.exe D:\TRELLIS\app_text.py
[SPARSE] Backend: spconv, Attention: flash_attn
Warp 1.5.0 initialized:
CUDA Toolkit 12.6, Driver 12.4
Devices:
"cpu" : "Intel64 Family 6 Model 143 Stepping 8, GenuineIntel"
"cuda:0" : "NVIDIA RTX 5880 Ada Generation" (48 GiB, sm_89, mempool enabled)
Kernel cache:
C:\Users\Admin\AppData\Local\NVIDIA\warp\Cache\1.5.0
D:\TRELLIS_env\Lib\site-packages\gradio_client\utils.py:1097: UserWarning: file() is deprecated and will be removed in a future version. Use handle_file() instead.
warnings.warn(
[SPARSE][CONV] spconv algo: auto
[ATTENTION] Using backend: flash_attn
D:\TRELLIS_env\Lib\site-packages\transformers\models\clip\modeling_clip.py:540: UserWarning: 1Torch was not compiled with flash attention. (Triggered internally at C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:555.)
attn_output = torch.nn.functional.scaled_dot_product_attention(
Running on local URL: http://0.0.0.0:9101
Could not create share link. Please check your internet connection or our status page: https://status.gradio.app.
Sampling: 100%|██████████| 25/25 [00:03<00:00, 7.67it/s]
Traceback (most recent call last):
File "D:\TRELLIS_env\Lib\site-packages\gradio\queueing.py", line 536, in process_events
response = await route_utils.call_process_api(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\TRELLIS_env\Lib\site-packages\gradio\route_utils.py", line 322, in call_process_api
output = await app.get_blocks().process_api(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\TRELLIS_env\Lib\site-packages\gradio\blocks.py", line 1935, in process_api
result = await self.call_function(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\TRELLIS_env\Lib\site-packages\gradio\blocks.py", line 1520, in call_function
prediction = await anyio.to_thread.run_sync( # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\TRELLIS_env\Lib\site-packages\anyio\to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\TRELLIS_env\Lib\site-packages\anyio\_backends\_asyncio.py", line 2505, in run_sync_in_worker_thread
return await future
^^^^^^^^^^^^
File "D:\TRELLIS_env\Lib\site-packages\anyio\_backends\_asyncio.py", line 1005, in run
result = context.run(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\TRELLIS_env\Lib\site-packages\gradio\utils.py", line 826, in wrapper
response = f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "D:\TRELLIS\app_text.py", line 103, in text_to_3d
outputs = pipeline.run(
^^^^^^^^^^^^^
File "D:\TRELLIS_env\Lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "D:\TRELLIS\trellis\pipelines\trellis_text_to_3d.py", line 227, in run
slat = self.sample_slat(cond, coords, slat_sampler_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\TRELLIS\trellis\pipelines\trellis_text_to_3d.py", line 184, in sample_slat
noise = sp.SparseTensor(
^^^^^^^^^^^^^^^^
File "D:\TRELLIS\trellis\modules\sparse\basic.py", line 70, in __init__
shape = self.__cal_shape(feats, coords)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\TRELLIS\trellis\modules\sparse\basic.py", line 119, in __cal_shape
shape.append(coords[:, 0].max().item() + 1)
^^^^^^^^^^^^^^^^^^
RuntimeError: max(): Expected reduction dim to be specified for input.numel() == 0. Specify the reduction dim with the 'dim' argument.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with app_text.py at text_to_3d, then follow trellis/pipelines/trellis_text_to_3d.py through run and sample_slat into trellis/modules/sparse/basic.py::__cal_shape. Reproduce the reported text-to-3d run and inspect why coords is empty before coords[:, 0].max(). Done means the reported RuntimeError no longer occurs and the pipeline completes successfully for the reproduction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- computer-graphics, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100