realcrane / Human-Trajectory-Prediction-via-Neural-Social-Physics

Our ECCV 2022 paper Human Trajectory Prediction via Neural Social Physics
131 stars 19 forks source link

An error repeats when I try to train the model #19

Open jjiwon-kim opened 1 year ago

jjiwon-kim commented 1 year ago

Whenever I try running train_nsp_w.py and train_nsp_wo.py, the following error shows up and I cannot continue training the model. Is it only me who gets this [out of index] error? And could you help me resolve this issue and actually make use of this model? I would much appreciate your help, thank you a lot in advance!

cf. In order to make sure that this is not a version issue, I set up my environment same as you, in terms of cuda, pytorch, and python version.

Traceback (most recent call last):
  File "train_nsp_wo.py", line 279, in <module>
    total_loss = train(path_train, scenes_train)
  File "train_nsp_wo.py", line 69, in train
    prediction, w_v = model.forward_next_step(current_step, current_vel, initial_speeds, dest,
  File "/home/jw-ws/Human-Trajectory-Prediction-via-Neural-Social-Physics-main/model_nsp_wo.py", line 423, in forward_next_step
    F2 = environment(current_step.detach(), first_frame, current_vel.detach(), semantic_map, k_scope, k_env, k_label_4, F0, device)
  File "/home/jw-ws/Human-Trajectory-Prediction-via-Neural-Social-Physics-main/model_nsp_wo.py", line 40, in environment
    environment_vision = semantic_map[
IndexError: index 1158 is out of bounds for axis 1 with size 1093
JiangbeiYue commented 1 year ago

Hi,

You can try to change the 274th line and the 276th line in train_nsp_wo.py into: semantic_maps_name_train = sorted(os.listdir(semantic_path_train)) semantic_maps_name_test = sorted(os.listdir(semantic_path_test)). This might be because It is different to read files for different computers or IDEs.