How to fix unexpected keyword argument error?

I’ve been trying to simulate some traffic in a roundabout connected to a t-intersection and it keeps coming up with the error, “unexpected keyword argument”. I’ve included my road graph and the simulation code along with the entire error message, can anyone help? (Furthermore, this is done on google colab using “Waymax” simulation software.

import dataclasses
import jax
from jax import numpy as jnp
from matplotlib import pyplot as plt

from waymax import config as _config
from waymax import dataloader
from waymax import datatypes
from waymax import visualization

import numpy as np
def roundabout_t_intersection_model(inputs):
  # Extract the state from the inputs.
  state = inputs['state']

  # Get the roadgraph from the state.
  roadgraph = state.roadgraph

  # Define the roundabout center.
  roundabout_center = jnp.array([0.0, 0.0])

  # Define the roundabout radius.
  roundabout_radius = 10.0

  # Define the number of lanes in the roundabout.
  num_lanes = 2

  # Define the lane width.
  lane_width = 3.5

  # Create a list to store the lanes.
  lanes = []

  # Iterate over the number of lanes.
  for i in range(num_lanes):
    # Define the lane offset.
    lane_offset = i * lane_width

    # Define the lane center.
    lane_center = roundabout_center + lane_offset

    # Define the lane points.
    lane_points = jnp.array([
      [lane_center[0] + roundabout_radius, lane_center[1]],
      [lane_center[0] - roundabout_radius, lane_center[1]]
    ])

    # Add the lane to the list.
    lanes.append(lane_points)

  # Define the t-intersection center.
  t_intersection_center = jnp.array([10.0, 10.0])

  # Define the t-intersection road width.
  t_intersection_road_width = 10.0

  # Define the t-intersection lane width.
  t_intersection_lane_width = 3.5

  # Define the t-intersection lanes.
  t_intersection_lanes = [
    # Northbound lane.
    np.array([
      [t_intersection_center[0], t_intersection_center[1] + t_intersection_road_width / 2],
      [t_intersection_center[0], t_intersection_center[1] + t_intersection_lane_width / 2]
    ]),
    # Eastbound lane.
    np.array([
      [t_intersection_center[0] + t_intersection_road_width / 2, t_intersection_center[1]],
      [t_intersection_center[0] + t_intersection_lane_width / 2, t_intersection_center[1]]
    ]),
    # Southbound lane.
    np.array([
      [t_intersection_center[0], t_intersection_center[1] - t_intersection_road_width / 2],
      [t_intersection_center[0], t_intersection_center[1] - t_intersection_lane_width / 2]
    ]),
    # Westbound lane.
    np.array([
      [t_intersection_center[0] - t_intersection_road_width / 2, t_intersection_center[1]],
      [t_intersection_center[0] - t_intersection_lane_width / 2, t_intersection_center[1]]
    ])
  ]

  # Combine the roundabout and t-intersection lanes.
  lanes.extend(t_intersection_lanes)

  # Return the lanes.
  return lanes

# Define the network model.
network_model = roundabout_t_intersection_model

# Define the simulation configuration.
sim_config = dataclasses.replace(
    _config.WOD_1_1_0_TRAINING,
    max_num_objects=64,
    network_model=network_model
)
# Set the network model for the simulation configuration.
sim_config.network_model = network_model

# Create a simulator.
simulator = dataloader.simulator(config=sim_config)

# Generate a scenario.
scenario = next(simulator)

# Plot the scenario.
img = visualization.plot_simulator_state(scenario, use_log_traj=True)
mediapy.show_image(img)

# Simulate the scenario.
for _ in tqdm(range(scenario.remaining_timesteps)):
  scenario = simulator.step(scenario)

# Plot the final state of the scenario.
img = visualization.plot_simulator_state(scenario, use_log_traj=True)
mediapy.show_image(img)

# Error message.
TypeError                                 Traceback (most recent call last)
<ipython-input-21-9affebfac1bd> in <cell line: 14>()
     12 
     13 # Define the simulation configuration.
---> 14 sim_config = dataclasses.replace(
     15     _config.WOD_1_1_0_TRAINING,
     16     max_num_objects=64,

/usr/lib/python3.10/dataclasses.py in replace(obj, **changes)
   1451     # changes that aren't fields, this will correctly raise a
   1452     # TypeError.
-> 1453     return obj.__class__(**changes)

TypeError: DatasetConfig.__init__() got an unexpected keyword argument 'network_model'

This should be producing a small animation of vehicles on the created roadgraph.

New contributor

strugglinguser is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật