StanfordASL/Trajectron-plus-plus

RuntimeError: stack expects a non-empty TensorList

QiyangZ opened this issue · 1 comments

Hello @BorisIvanovic ,
First of all, thank you for sharing the code of this amazing project!
I trained this model with full nuScene dataset, but I encountered some strange errors when visualizing the results.
I just trained the model and loaded model_registrar-12.pt from corresponding folder (not in int_ee, but in the folder that generated after training). Except that I didn't change anything in NuScenes Qualitative.ipynb. But when I run it, there was a RuntimeError: stack expects a non-empty TensorList. I'm sure I'm in the correct environment and used the correct kernel. The whole day I tried to figure it out but failed. Could you help me with that? The details is below:

Thank you in advance!

Best wishes

RuntimeError                              Traceback (most recent call last)
<ipython-input-38-c36cd443b374> in <module>
      5                                    timestep,
      6                                    ph,
----> 7                                    num_samples=500)
      8 
      9     predictions_mm = eval_stg.predict(scene,

[/mnt/cephFS/home/qzong/Trajectron-plus-plus/trajectron/model/trajectron.py](https://vscode-remote+ssh-002dremote-002bgpu-002elsr-002eei-002etum-002ede.vscode-resource.vscode-cdn.net/mnt/cephFS/home/qzong/Trajectron-plus-plus/trajectron/model/trajectron.py) in predict(self, scene, timesteps, ph, num_samples, min_future_timesteps, min_history_timesteps, z_mode, gmm_mode, full_dist, all_z_sep)
    183                                         gmm_mode=gmm_mode,
    184                                         full_dist=full_dist,
--> 185                                         all_z_sep=all_z_sep)
    186 
    187             predictions_np = predictions.cpu().detach().numpy()

[/mnt/cephFS/home/qzong/Trajectron-plus-plus/trajectron/model/mgcvae.py](https://vscode-remote+ssh-002dremote-002bgpu-002elsr-002eei-002etum-002ede.vscode-resource.vscode-cdn.net/mnt/cephFS/home/qzong/Trajectron-plus-plus/trajectron/model/mgcvae.py) in predict(self, inputs, inputs_st, first_history_indices, neighbors, neighbors_edge_value, robot, map, prediction_horizon, num_samples, z_mode, gmm_mode, full_dist, all_z_sep)
   1126                                                                    neighbors_edge_value=neighbors_edge_value,
   1127                                                                    robot=robot,
-> 1128                                                                    map=map)
   1129 
   1130         self.latent.p_dist = self.p_z_x(mode, x)

[/mnt/cephFS/home/qzong/Trajectron-plus-plus/trajectron/model/mgcvae.py](https://vscode-remote+ssh-002dremote-002bgpu-002elsr-002eei-002etum-002ede.vscode-resource.vscode-cdn.net/mnt/cephFS/home/qzong/Trajectron-plus-plus/trajectron/model/mgcvae.py) in obtain_encoded_tensors(self, mode, inputs, inputs_st, labels, labels_st, first_history_indices, neighbors, neighbors_edge_value, robot, map)
    494 
    495         if self.hyperparams['incl_robot_node']:
--> 496             robot_future_encoder = self.encode_robot_future(mode, x_r_t, y_r)
    497             x_concat_list.append(robot_future_encoder)
    498 

[/mnt/cephFS/home/qzong/Trajectron-plus-plus/trajectron/model/mgcvae.py](https://vscode-remote+ssh-002dremote-002bgpu-002elsr-002eei-002etum-002ede.vscode-resource.vscode-cdn.net/mnt/cephFS/home/qzong/Trajectron-plus-plus/trajectron/model/mgcvae.py) in encode_robot_future(self, mode, robot_present, robot_future)
    708         initial_state = (initial_h, initial_c)
    709 
--> 710         _, state = self.node_modules['robot_future_encoder'](robot_future, initial_state)
    711         state = unpack_RNN_state(state)
    712         state = F.dropout(state,

[~/miniconda3/envs/trajectron](https://vscode-remote+ssh-002dremote-002bgpu-002elsr-002eei-002etum-002ede.vscode-resource.vscode-cdn.net/home/qzong/Trajectron-plus-plus/experiments/nuScenes/~/miniconda3/envs/trajectron)++/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    530             result = self._slow_forward(*input, **kwargs)
    531         else:
--> 532             result = self.forward(*input, **kwargs)
    533         for hook in self._forward_hooks.values():
    534             hook_result = hook(self, input, result)

[~/miniconda3/envs/trajectron](https://vscode-remote+ssh-002dremote-002bgpu-002elsr-002eei-002etum-002ede.vscode-resource.vscode-cdn.net/home/qzong/Trajectron-plus-plus/experiments/nuScenes/~/miniconda3/envs/trajectron)++/lib/python3.6/site-packages/torch/nn/modules/rnn.py in forward(self, input, hx)
    557         if batch_sizes is None:
    558             result = _VF.lstm(input, hx, self._flat_weights, self.bias, self.num_layers,
--> 559                               self.dropout, self.training, self.bidirectional, self.batch_first)
    560         else:
    561             result = _VF.lstm(input, batch_sizes, hx, self._flat_weights, self.bias,

RuntimeError: stack expects a non-empty TensorList

I solved this problem with changing model. Thank you all~