Skip to content

Question about carla: TypeError: getattr(): attribute name must be string #32

@itismycode

Description

@itismycode

When bash scripts/carlatrain.sh:
The following error occurred:
Traceback (most recent call last):
File "carlatrain.py", line 269, in main
workspace.train()
File "/home/z/RL-ViGen/carlatrain.py", line 188, in train
self.replay_storage.add(time_step)
File "/home/z/RL-ViGen/replay_buffer.py", line 50, in add
value = time_step[spec.name]
File "/home/z/RL-ViGen/wrappers/carla_wrapper.py", line 60, in getitem
return getattr(self, attr)
File "/home/z/RL-ViGen/wrappers/carla_wrapper.py", line 60, in getitem
return getattr(self, attr)
TypeError: getattr(): attribute name must be string
Is it because the step_type is missing in the following code?I couldn't find where the problem was.Looking forward to your help!
data_specs = (self.train_env.observation_spec(),
self.train_env.action_spec(),
specs.Array((1,), np.float32, 'reward'),
specs.Array((1,), np.float32, 'discount'))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions