ucsd-hdsi-dvs / V2CE-Toolbox

The official implementation of the ICRA 2024 paper "V2CE: Video to Continuous Events Simulator." This repo provides a out-of-the-box tool that you can easily and swiftly convert your video to highly realistic raw event stream and generate visualized event frame videos.
MIT License
10 stars 1 forks source link

Problem in generating events with sequences of frames #3

Open ChiaraBoretti opened 3 days ago

ChiaraBoretti commented 3 days ago

Hi, Thanks for this beautiful work! I'm trying to generate the events stream from a sequence of images with a resolution of 346x260 but I get this error:

Traceback (most recent call last): File "/srv/newpenny/Robotics/chiara/V2CE-Toolbox/v2ce.py", line 344, in event_stream_per_frame.extend(ldati(stage2_input[i:i+args.stage2_batch_size])) File "/srv/newpenny/Robotics/chiara/V2CE-Toolbox/scripts/LDATI.py", line 197, in sample_voxel_statistical logger.debug(f"max of additional_ts: {torch.max(additional_ts)}") RuntimeError: max(): Expected reduction dim to be specified for input.numel() == 0. Specify the reduction dim with the 'dim' argument

The greyscale video of events is correctly generated but the .npz file is not. Do you have any idea of what could be the problem?

Asa-Hopkins commented 17 hours ago

I encountered this issue too, it seems to be because "additional_ts" is sometimes empty and the maximum value of an empty tensor isn't defined. Since the line in question is a debugging line I just commented it out, as well as the next line where it tries to check the minimum because of the same error. It seems to work after that.

miracleyoo commented 5 hours ago

Thank you @Asa-Hopkins for the trial and explanation. Yes, the error message shows that the variable additional_ts in your case is completely empty, which could be caused by an empyt input y. I'm pushed a update to disable max/min check when additional_ts is empty. If possible, would any of you mind sending a video sample that could trigger this bug? I want to look into it since I haven't encountered the same issue previously. Thanks for your support.

miracleyoo commented 5 hours ago

For the easiest solution of this types of errors at the moment, you can simply set the --log_level to info.