pedro-mgb / pedestrian-arc-lstm-smf

Implementation of Arc-LSTM-SMF model, and its standalone parts, to the task of pedestrian trajectory forecast
MIT License
3 stars 1 forks source link

FileNotFoundError: [WinError 2] The system cannot find the file specified #1

Closed haris-kkk123 closed 9 months ago

haris-kkk123 commented 1 year ago

first of all great work. i run your model it is working great. but i am facing the below error when i run the visualization part. please how i solve this error. thank you

C:\Users\dynam\Desktop\Asif\pedestrian-arc-lstm-smf-main>python other_scripts/plot_predictions_social.py --test_dir datasets_in_trajnetpp21/test/crowds_zara02.ndjson --model_paths saved_models/other_models_21/lstm_social_None_modes1/crowds_zara02.ndjson saved_models/arc_lstm_smf_21/zara_arc_lstm_smf_trajnetpp21.pt --model_labels S-LSTM Arc-LSTM-SMF --environment_location datasets_utils/environment/crowds_zara.txt --animate Retrieving test dataset in datasets_in_trajnetpp21/test/crowds_zara02.ndjson Done! Retrieving test MODEL PREDICTIONS in saved_models/other_models_21/lstm_social_None_modes1/crowds_zara02.ndjson Done! Loading model(s) from saved_models/arc_lstm_smf_21/zara_arc_lstm_smf_trajnetpp21.pt Done! Loaded 1 FieldsWithInteractionModuleAndLSTM model Loaded all models. Beginning evaluation / display of trajectory predictions Batch 1/31Traceback (most recent call last): File "other_scripts/plot_predictions_social.py", line 258, in main(new_args) File "other_scripts/plot_predictions_social.py", line 107, in main plotted = plot_method_predictions_situation(args, predictions_for_situation, obs_traj[:, start:end], File "other_scripts/plot_predictions_social.py", line 169, in plot_method_predictions_situation anim.save() File "C:\Users\dynam\Desktop\Asif\pedestrian-arc-lstm-smf-main\models\utils\plotting.py", line 282, in save self.anim.save(path, writer) File "C:\Users\dynam\anaconda3\envs\arclstmsmf\lib\site-packages\matplotlib\animation.py", line 1139, in save with mpl.rc_context({'savefig.bbox': None}), \ File "C:\Users\dynam\anaconda3\envs\arclstmsmf\lib\contextlib.py", line 113, in enter return next(self.gen) File "C:\Users\dynam\anaconda3\envs\arclstmsmf\lib\site-packages\matplotlib\animation.py", line 249, in saving self.setup(fig, outfile, dpi, *args, **kwargs) File "C:\Users\dynam\anaconda3\envs\arclstmsmf\lib\site-packages\matplotlib\animation.py", line 338, in setup self._run() File "C:\Users\dynam\anaconda3\envs\arclstmsmf\lib\site-packages\matplotlib\animation.py", line 348, in _run self._proc = subprocess.Popen( File "C:\Users\dynam\anaconda3\envs\arclstmsmf\lib\subprocess.py", line 858, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\dynam\anaconda3\envs\arclstmsmf\lib\subprocess.py", line 1311, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] The system cannot find the file specified

pedro-mgb commented 1 year ago

Hi, thank you for your interesting and commenting this issue. I don't remember ever having this issue in saving the animation. Just to confirm, you set up the project like in getting started, and installed the requirements from requirements.txt, and not requirements_lightweight.txt?

haris-kkk123 commented 1 year ago

Thank you for your quick response. i already solved this issue by installing "ffmpeg" library. would you like to tell me how i limit the pedestrians in the scene e.g it plot only one pedestrian path and second right now it is only compare with one other model so how i should increase the number of models for comparing? where should i do these changes? thank you.

pedro-mgb commented 1 year ago

Good to know it is fixed, ffmpeg is indeed one dependency required for the animations.

  1. If you want to compare predictions for more than 2 models, you should be able to provide more models in the --model_paths/--model_labels. e.g. adapting your command line call to

python other_scripts/plot_predictions_social.py --test_dir datasets_in_trajnetpp21/test/crowds_zara02.ndjson --model_paths saved_models/base_lstm_trajnetpp21.pt saved_models/other_models_21/lstm_social_None_modes1/crowds_zara02.ndjson saved_models/other_models_21/lstm_directional_None_modes1/crowds_zara02.ndjson saved_models/arc_lstm_smf_21/zara_arc_lstm_smf_trajnetpp21.pt --model_labels LSTM S-LSTM D-LSTM Arc-LSTM-SMF --environment_location datasets_utils/environment/crowds_zara.txt --animate

  1. There currently isn't a way to limit the number of pedestrians to display in each scene / situation. It may be easy to implement, depending on what you want to achieve. Do you want to just display up to X pedestrians per animation, or just display animations that have X pedestrians? Then you can slice the PyTorch tensor in this place of the code https://github.com/pedro-mgb/pedestrian-arc-lstm-smf/blob/main/other_scripts/plot_predictions_social.py#L165 to only get predictions up to X pedestrains, and you can even put X as a command-line argument for some flexibility. Lemme know if this seems clear to you or if you had something else in mind.
pedro-mgb commented 9 months ago

@haris-kkk123 closing this issue due to inactivity.

If by chance you still need any help, we can re-open it.

Thanks, and happy holidays!