Skip to content

"python ./lora.py" crashed on "RuntimeError: view size is not compatible with input tensor's size and stride" #35

@jeffDebug

Description

@jeffDebug

I was trying to increase the batch size in lora.py, changing the following line (36):

BATCH_SIZE = 2

Then run:

python ./lora.py

It crashed with the following backtrace:

ERROR:main:Error in batch 172: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
ERROR:main:Traceback (most recent call last):
File "/home/jeff/csm-streaming/./lora.py", line 915, in finetune
loss = single_pass_forward(model, bridging_module,
File "/home/jeff/csm-streaming/./lora.py", line 706, in single_pass_forward
loss = compute_loss_for_codebooks_single_pass(
File "/home/jeff/csm-streaming/./lora.py", line 648, in compute_loss_for_codebooks_single_pass
flat_dec = decoder_out.view(bsz * seq_len, -1)
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.

Any ideas/suggeations to fix this? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions