NagabhushanSN95 / DeCOMPnet

Official code release for the ISMAR 2022 paper "Temporal View Synthesis of Dynamic Scenes through 3D Object Motion Estimation with Multi-Plane Images"
MIT License
5 stars 0 forks source link

Arguments misalignment in FramePredictor2.py #3

Open jimmyfyx opened 11 months ago

jimmyfyx commented 11 months ago

Hi,

The following problem arises when I try to run demo2() in VeedDynamicTester01.py:

Testing begins for Test0002 0%| | 0/520 [00:02<?, ?it/s] forward() takes 2 positional arguments but 3 were given Traceback (most recent call last): File "VeedDynamicTester01.py", line 475, in main() File "VeedDynamicTester01.py", line 462, in main demo2() File "VeedDynamicTester01.py", line 158, in demo2 start_testing(train_configs, test_configs) File "VeedDynamicTester01.py", line 20, in start_testing output_dirpath = Tester.start_testing(train_configs, test_configs, save_intermediate_results=False)
File "/home/yixiaof2/DeCOMPnet/src/Tester01.py", line 283, in start_testing pred_frames, masks, extras = tester.predict_next_frame2(video_name, seq_num, pred_frame_num,
File "/home/yixiaof2/DeCOMPnet/src/Tester01.py", line 101, in predict_next_frame2 pred_frames, pred_frames_mask, extras = self.predict_next_frame1(input_dict, return_intermediate_results)
File "/home/yixiaof2/DeCOMPnet/src/Tester01.py", line 84, in predict_next_frame1 output_batch = self.frame_predictor(input_batch, return_intermediate_results) File "/home/yixiaof2/.conda/envs/decomp/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs) TypeError: forward() takes 2 positional arguments but 3 were given

It seems that demo2() uses FramePredictor2, and its forward method only takes one argument input_batch, but we try to pass another return-intermediate_results variable to it, so I wonder is this a bug or I did something wrong?

Thanks!

NagabhushanSN95 commented 11 months ago

Thanks. It's definitely a bug. Please modify the forward function of FramePredictor2, FramePredictor3, FramePredictor4 to accept an additional variable return_intermediate_results: bool = False similar to FramePredictor1. That should solve this issue. We will update the code to fix this bug.

Please note that FramePredictor2, FramePredictor3, FramePredictor4 are used for ablations, where ground truth is available for some entities. The main DeCOMPnet model uses FramePredictor01 only.

jimmyfyx commented 11 months ago

OK Thanks!