metadriverse / trafficgen

[ICRA 2023] The official code for paper "TrafficGen: Learning to Generate Diverse and Realistic Traffic Scenarios"
Apache License 2.0
149 stars 24 forks source link

modify data_usage in cluster training #14

Closed lemyx closed 1 year ago

lemyx commented 1 year ago

Modify cluster.yaml. Change data_path, data_usage, run:

How to change the data_usage?

Alan-LanFeng commented 1 year ago

'data_usage' denotes how many '*.pkl' data you want to use in training. After you processed all the waymo data, there will be about 70000 pkl data in total. You can set any number in the range of 0~70000 to train your model. For example, data_usage: 70000. The training script will automatically split 20% data for validation.

lemyx commented 1 year ago

'data_usage' denotes how many '*.pkl' data you want to use in training. After you processed all the waymo data, there will be about 70000 pkl data in total. You can set any number in the range of 0~70000 to train your model. For example, data_usage: 70000. The training script will automatically split 20% data for validation.

Thanks for your reply!

As metioned in README.md, when considering Cluster Training, only train_act.py exists, without train_init.py.

Is there a reason for this?

Alan-LanFeng commented 1 year ago

'data_usage' denotes how many '*.pkl' data you want to use in training. After you processed all the waymo data, there will be about 70000 pkl data in total. You can set any number in the range of 0~70000 to train your model. For example, data_usage: 70000. The training script will automatically split 20% data for validation.

Thanks for your reply!

As metioned in README.md, when considering Cluster Training, only train_act.py exists, without train_init.py.

Is there a reason for this?

Not really. You can also execute train_init.py. For simplicity, we just omitted that. Will update README here.

lemyx commented 1 year ago

'data_usage' denotes how many '*.pkl' data you want to use in training. After you processed all the waymo data, there will be about 70000 pkl data in total. You can set any number in the range of 0~70000 to train your model. For example, data_usage: 70000. The training script will automatically split 20% data for validation.

Thanks for your reply! As metioned in README.md, when considering Cluster Training, only train_act.py exists, without train_init.py. Is there a reason for this?

Not really. You can also execute train_init.py. For simplicity, we just omitted that. Will update README here.

Thank you! Do I need to train_init.py first, then train_act.py? By the way, should I change the data_usage in train_init.py from 10000 to 70000?

Alan-LanFeng commented 1 year ago

You can train them in an arbitrary sequence. We used 70000 data in the paper. However, the data usage depends on your training budget.

lemyx commented 1 year ago

Thanks for your timely reply.

It seems that before generating the traffic trafectories, a certain number of cars should be placed. Maybe what I have understood is different from the real process reflected in the paper. Could you please explain about this problem somewhat?

Besides, after I get the model, what I want to do is to evaluate its performance according to some quantative metrics, such ad ADE. Where can I find the related scripts?

Eventually, the max_epoch defined in cluster.yaml is 50, but the training seems to last 100 epochs, it seems that the cluster.yaml doesn't control the number of training epochs.

Alan-LanFeng commented 1 year ago
  1. The training scripts (train_init.py and train_act.py) are only used to get two models mentioned in the paper, and the training of two models is independent. If you want to generate traffic scenarios, you can use our released models and run generate_scenarios.py.

  2. In test_init.py and test_act.py

  3. Thanks for pointing this out. We have updated the code so that you can define max epochs in the configs.

lemyx commented 1 year ago

Thanks for your help.

As for generating traffic scenarios, could I use my own trained init_model and act_model instead of released models by the repository?

Alan-LanFeng commented 1 year ago

Of course