nachiket92 / PGP

Code for "Multimodal Trajectory Prediction Conditioned on Lane-Graph Traversals," CoRL 2021.
https://proceedings.mlr.press/v164/deo22a.html
MIT License
217 stars 36 forks source link

Latent var only experiments error #17

Closed han1222 closed 2 years ago

han1222 commented 2 years ago

I want to train model with Latent var only mode.

from issue #13 I changed train config but i got this Exception

Do you know what the problem is ?

====== Loading NuScenes tables for version v1.0-trainval... 23 category, 8 attribute, 4 visibility, 64386 instance, 12 sensor, 10200 calibrated_sensor, 2631083 ego_pose, 68 log, 850 scene, 34149 sample, 2631083 sample_data, 1166187 sample_annotation, 4 map, Done loading in 20.600 seconds.

Reverse indexing ... Done reverse indexing in 5.2 seconds.

Epoch (1/100) Traceback (most recent call last): File "train.py", line 38, in trainer.train(num_epochs=int(args.num_epochs), output_dir=args.output_dir) File "/media/han/289e8c3e-12db-47da-8b89-15b58bef567d/home/han/prediction_256/PGP/train_eval/trainer.py", line 109, in train train_epoch_metrics = self.run_epoch('train', self.tr_dl) File "/media/han/289e8c3e-12db-47da-8b89-15b58bef567d/home/han/prediction_256/PGP/train_eval/trainer.py", line 153, in run_epoch predictions = self.model(data['inputs']) File "/home/han/.local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, *kwargs) File "/media/han/289e8c3e-12db-47da-8b89-15b58bef567d/home/han/prediction_256/PGP/models/model.py", line 35, in forward outputs = self.decoder(agg_encoding) File "/home/han/.local/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(input, **kwargs) File "/media/han/289e8c3e-12db-47da-8b89-15b58bef567d/home/han/prediction_256/PGP/models/decoders/lvm.py", line 57, in forward raise Exception('Expected ' + str(self.num_samples) + 'encodings for each train/val data') Exception: Expected 1000encodings for each train/val data

Thank you in advance.

nachiket92 commented 2 years ago

My bad, there's one more change needed in the training config file for the latent var only experiments.

In decoder_args, agg_type should be 'combined'.

This is because without the graph traversals to selectively aggregate node encodings along sampled routes, the aggregator returns a single encoding of the entire scene.

han1222 commented 2 years ago

I also remove 'pi_bc' in 'tr_metric' , 'val_metrics' and then It works

Thank you for your prompt response.