anuragranj / flowattack

Attacking Optical Flow (ICCV 2019)
https://flowattack.is.tue.mpg.de
Other
59 stars 16 forks source link

Problem when trying to prepare training data #5

Open phoebehxf opened 3 years ago

phoebehxf commented 3 years ago

Hi! Thanks so much for the code. I'm trying to run the prepare_train_data.py but it fails, with the report below:

Retrieving frames 0%| | 0/156 [00:00<?, ?it/s]Traceback (most recent call last): File "data/prepare_train_data_m.py", line 95, in main() File "data/prepare_train_data_m.py", line 77, in main Parallel(n_jobs=args.num_threads)(delayed(dump_example)(scene) for scene in tqdm(data_loader.scenes)) File "/home/wpf/anaconda3/envs/torch1.4/lib/python3.6/site-packages/joblib/parallel.py", line 1041, in call if self.dispatch_one_batch(iterator): File "/home/wpf/anaconda3/envs/torch1.4/lib/python3.6/site-packages/joblib/parallel.py", line 859, in dispatch_one_batch self._dispatch(tasks) File "/home/wpf/anaconda3/envs/torch1.4/lib/python3.6/site-packages/joblib/parallel.py", line 777, in _dispatch job = self._backend.apply_async(batch, callback=cb) File "/home/wpf/anaconda3/envs/torch1.4/lib/python3.6/site-packages/joblib/_parallel_backends.py", line 208, in apply_async result = ImmediateResult(func) File "/home/wpf/anaconda3/envs/torch1.4/lib/python3.6/site-packages/joblib/_parallel_backends.py", line 572, in init self.results = batch() File "/home/wpf/anaconda3/envs/torch1.4/lib/python3.6/site-packages/joblib/parallel.py", line 263, in call for func, args, kwargs in self.items] File "/home/wpf/anaconda3/envs/torch1.4/lib/python3.6/site-packages/joblib/parallel.py", line 263, in for func, args, kwargs in self.items] File "data/prepare_train_data_m.py", line 43, in dump_example for sample in data_loader.get_scene_imgs(scene_data): File "/home/wpf/Public/hxf/flowattack/data/kitti_raw_loader.py", line 86, in get_scene_imgs yield construct_sample(scene_data, i, frame_id) File "/home/wpf/Public/hxf/flowattack/data/kitti_raw_loader.py", line 76, in construct_sample sample.append(self.generate_depth_map(scene_data, i)) AttributeError: 'KittiRawLoader' object has no attribute 'generate_depth_map' 0%| | 0/156 [00:00<?, ?it/s]

I looked up the project and there is no defination for this 'generate_depth_map'. Is there something missing? It would mean a lot to me if you could help with this problem. Thank you again!

anuragranj commented 3 years ago

Could you disable --with-gt flag. You don't need ground truths here. Also the function is available here - https://github.com/ClementPinard/SfmLearner-Pytorch/blob/master/data/kitti_raw_loader.py#L165-L182