Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test.py settings partial settings not working #8

Open
Lilyoung2000 opened this issue Nov 20, 2023 · 13 comments
Open

Test.py settings partial settings not working #8

Lilyoung2000 opened this issue Nov 20, 2023 · 13 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@Lilyoung2000
Copy link

Hello, do you still remember me? I still have some issues with the test.py, when I set save_slides=True, the folder trained_models/GST_predictor_rand/social_eval/41665 where the results are saved is empty. There is also a problem with the --test_case parameter setting. When I set any other positive number, the test will still run for 500 episodes. I'm confused and made some modifications to evaluation.py but it doesn't work. Do you have any suggestions? Maybe the uploaded file is incomplete

@Shuijing725
Copy link
Owner

Shuijing725 commented Nov 22, 2023

Sorry about that. Can you copy-paste the following codes into line 236 in crowd_sim_pred_real_gst.py (right before plt.pause(0.1))?

  # save plot for slide show
  if self.config.save_slides:
      import os
      folder_path = os.path.join(self.config.save_path, str(self.episode_k))
      if not os.path.isdir(folder_path):
          os.makedirs(folder_path, exist_ok = True)
      plt.savefig(os.path.join(folder_path, str(self.step_counter)+'.png'), dpi=300)

Also, in test.py, you need to set both --visualize and --save_slides to True.

@Lilyoung2000
Copy link
Author

Thanks for the quick reply, that works. But I still have the following three questions

  1. When the test case is changed from -1 to a positive number, 500 cases are still run.
  2. I want to add other mechanisms to the network defined by selfAttn_srnn_temp_node.py. Is it feasible?
  3. I trained other trajectory predictors and got a pkl file, but when I converted it to a pt file and replaced 41665.pt, an error occurred.
    _cgi-bin_mmwebwx-bin_webwxgetmsgimg  MsgID=1205188368518026180 skey=@crypt_51605252_6b4e81ce556782e936e9620a36e582cc mmweb_appid=wx_webfilehelper

@Shuijing725
Copy link
Owner

  1. Yes it is a bug. For a quick fix, you can set the desired seed in this line
  2. Yes you can redefine the human-human attention function here and robot-human attention here
  3. I'm confused about what you mean. "41665.pt" sounds like the name of a robot policy checkpoint, not a human trajectory predictor.

@Shuijing725 Shuijing725 added bug Something isn't working enhancement New feature or request labels Nov 29, 2023
@Shuijing725
Copy link
Owner

Shuijing725 commented Dec 3, 2023

Sorry about that. Can you copy-paste the following codes into line 236 in crowd_sim_pred_real_gst.py (right before plt.pause(0.1))?

  # save plot for slide show
  if self.config.save_slides:
      import os
      folder_path = os.path.join(self.config.save_path, str(self.episode_k))
      if not os.path.isdir(folder_path):
          os.makedirs(folder_path, exist_ok = True)
      plt.savefig(os.path.join(folder_path, str(self.step_counter)+'.png'), dpi=300)

Also, in test.py, you need to set both --visualize and --save_slides to True.

The code for saving slides is added in save_slides branch. The output figures are saved in your_model_path/social_eval/ folder. Please let me know if you have any issues.

@Lilyoung2000
Copy link
Author

Awesome, everything you said is correct! What should I do if I want to change the visualization style? Specifically, I want to add a dotted line on the path where the robot moves, so that the trajectory of the robot is more intuitive.

@Shuijing725
Copy link
Owner

Shuijing725 commented Dec 30, 2023

To achieve this, you can use some data structure to save all positions of the robot before the episode ends, then draw a line between every pair of adjacent positions.

@Lilyoung2000
Copy link
Author

Thank you! But where is the script for the visualization file

@Shuijing725
Copy link
Owner

The code is in another repo. I just added you as a collaborator. The code is in trajectory_graphing branch (check the latest few commits in this branch). Note that the code is not cleaned, and please don't overwrite anything.

@Lilyoung2000
Copy link
Author

Thanks for your support, I found the visualization files in that branch.
1704164764874
But why can crowd++ visualize without this script, so I have some questions, how to modify the visualization of crowd++

@Shuijing725
Copy link
Owner

Shuijing725 commented Jan 2, 2024

Sorry, I thought we were talking about another paper. I just added you to the correct repo. I believe the code is in "adds saving episode trajectory plot capability" commit in "render_traj" branch. And again, please don't overwrite anything in the repo.

@Lilyoung2000
Copy link
Author

I'm still a little confused, I think we're talking about the Intention Aware Robot Crowd Navigation with Attention-Based Interaction Graph article, and its repository. Your previous work is great and I know about it, but what I want to modify is this visualization.
31e17a771f9ab1833ec60ff9b4e3b78
I think the submission of adds saving episode trajectory plot capability may not be the key.

@Lilyoung2000
Copy link
Author

I think the visualization file in the CrowdNav_Prediction_AttnGraph project may be in crowd_sim.py. But it doesn't work when I make simple changes to the visualization, like when I change the color on line 758

@Shuijing725
Copy link
Owner

Shuijing725 commented Mar 6, 2024

Sorry about the late reply. The CrowdNav_Prediction repo is indeed the development version of our ICRA 2023 paper, not ICRA 2021 paper.
It's easier for me to help you if you can give me the error trace or output figure and what changes you made to which file(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants