Robotmurlock / TNT-VectorNet-and-HOME-Trajectory-Forecasting

Custom implementation of TNT-VectorNet and HOME architectures
MIT License
72 stars 13 forks source link

AttributeError: 'NoneType' object has no attribute 'data_process' #3

Closed wuhaoran111 closed 1 year ago

wuhaoran111 commented 1 year ago

Hello, i have a problem again, and this time i don't know how to solve it.

I have run the script python3 common_data_processing/script_vectorize_hd_maps.py --cfg [cfg] and python3 home/script_train_heatmap.py --cfg [cfg] and i have the interval/train and interval/val now

but when i try to run: python3 home/script_train_trajectory_forecaster.py --cfg [cfg] i got this error:

Traceback (most recent call last):
  File "home/script_train_trajectory_forecaster.py", line 59, in <module>
    run(config_parser.GlobalConfig.load(steps.get_config_path()))
  File "home/script_train_trajectory_forecaster.py", line 28, in run
    tnt = LightningTrajectoryForecaster(
AttributeError: 'NoneType' object has no attribute 'data_process'

Do you know what cause this? Below is the setting of home.yaml:

log:
  level: 'DEBUG'
global_parameters:
  trajectory_history_window_length: 20
  trajectory_future_window_length: 30
global_path: '/home/cunjun/wuhr/HOME'
model_storage_path: '/home/cunjun/wuhr/HOME/model_storage'
data_process:
  input_path: '../dataset'
  output_path: 'internal'
  n_processes: 1
  visualize: False
  parameters:
    trajectory_min_history_window_length: 5
    object_trajectory_min_history_window_length: 5
    object_trajectory_min_future_window_length: 3
    object_distance_threshold: 100
    centerline_radius_scale: 3.0
    add_neighboring_lanes: True
    lane_radius_scale: 5.0
    min_lane_radius: 50.0
raster:
  data_process:  # Data processing for HOME architecture
    input_path: 'internal'  # Path to vectorized HD maps
    output_path: 'internal_raster'  # Output path - only for testing
    visualize: True  # Visualize - only for testing
    debug_visualize: True
    parameters:
      agent_view_window_size: 224  # Agent does not see any objects outside its view (112 radius)
      object_shape: [6, 6]  # Agent and neighbours object shape - shape drawn on input image
      centerline_point_shape: [6, 6]  # Centerline object shape - shape drawn on input image
      gauss_kernel_size: 25  # Gauss kernel for ground truth trajectory end point
      gauss_kernel_sigma: 4
      max_neighbours: 20  # Maximum number of neighbours (moving objects)
  train_tf:  # Training configuration to trajectory forecaster (one of two components)
    train_input_path: 'internal/train'  # Path to train dataset
    val_input_path: 'internal/val'  # Path to val dataset
    output_path: 'model_storage/heatmap_tf'  # Path
    n_workers: 8  # Dataloader workers
    model_name: 'home-forecaster-baseline'  # Model (experiment) name
    parameters:
      epochs: 20  # Number of epochs for training
      lr: 0.01  # Learning rate
      batch_size: 128  # Batch size
      sched_step: 10  # Learning rate scheduler
      sched_gamma: 0.1
  train_heatmap:
    train_input_path: 'TODO'  # TODO: Hardcoded
    val_input_path: 'TODO'  # TODO: Hardcoded
    model_name: 'home-baseline'  # Model (experiment) name
    n_workers: 8  # Dataloader workers
    resume: True  # Resume from last checkpoint
    starting_checkpoint_name: 'last.ckpt'  # Path to checkpoint in case the training is resumed
    parameters:
      epochs: 15  # Number of epochs for training
      sampler_targets: 6  # Number of anchors (end point) to sample from heatmap (top k)
      sampler_radius: 2  # Greedy sampling algorithm radius (check code for more information)
      batch_size: 16  # Batch size
      augmentation: True  # Use horizontal flip augmentation
      base_lr: 0.001  # Learning rate
      sched_step: 4  # Learning rate scheduler
      sched_gamma: 0.5
evaluation:
  input_path: 'internal_graph'
  output_path: 'result'
  model_path: 'model_storage/vectornet_traj_scoring'
  visualize: False
Robotmurlock commented 1 year ago

Hey! It seems that I forgot to remove some parameter that was used for both HOME and TNT. I created pull request for branch fix/home-using-graph-params. Please checkout and try it again. I will merge if everything is okay for you.

wuhaoran111 commented 1 year ago

Thank you. I think this revision can help.

Previously i just comment this line, and i found that the results of the pretrained model is not the same as you published (but quite similar).

I'll try if it is caused by this.

Robotmurlock commented 1 year ago

Great. I am closing this issue as the problem is resolved.