ChatSim icon indicating copy to clipboard operation
ChatSim copied to clipboard

RuntimeError: The size of tensor a (50) must match the size of tensor b (10) at non-singleton dimension 1 #25

Open nevergone123 opened this issue 9 months ago • 5 comments

I change the frames from 50 to 10, and run the following command: python main.py -y config/waymo-1006.yaml -p 'Remove all cars.Viewpoints ahead slowly and A chevrolet driving away from me fast.' -s demo

I got the following output:

/root/AImodel/wenke/ChatSim/chatsim/background/inpainting/Inpaint-Anything/segment_anything/segment_anything/modeling/tiny_vit_sam.py:657: UserWarning: Overwriting tiny[0/1927]_512 in registry with segment_anything.modeling.tiny_vit_sam.tiny_vit_21m_512. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
sttn
Traceback (most recent call last):
  File "remove_anything_video_npy.py", line 288, in <module>
    all_frame_rm_w_mask = model.forward_inpainter(frames, masks)
  File "remove_anything_video_npy.py", line 132, in forward_inpainter
    frames = inpaint_video_with_builded_sttn(
  File "/root/miniconda3/envs/chatsim/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/root/AImodel/wenke/ChatSim/chatsim/background/inpainting/Inpaint-Anything/sttn_video_inpaint.py", line 91, in inpaint_video_with_builded_sttn
    feats = (feats * (1 - _masks).float()).view(video_length, 3, h, w)
RuntimeError: The size of tensor a (50) must match the size of tensor b (10) at non-singleton dimension 1

This won‘t happen if I set frames as 50. I think there's a hardcode remains, but I failed to find it. Do you know how to generate a video with a different frame number? Many thanks!

nevergone123 avatar May 19 '24 07:05 nevergone123