Jingliang-Duan / DSAC-T

DSAC-v2; DASC; Distributional Soft Actor-Critic
210 stars 20 forks source link

I try CarRacing but got 'TypeError: can only concatenate tuple (not "int") to tuple' #8

Open oowadanoko opened 5 months ago

oowadanoko commented 5 months ago

It seems caused by the shape of observation_space. obs_dim is a tuple (4, 96, 96), but act_dim is a scalar 3. I use default arguments (same with example_train/main.py). Should I use some different arguments for running this task? Your papar got an excellent result in this task.

Traceback (most recent call last):
  File ".\carracing.py", line 156, in <module>
    alg = create_alg(**args)
  File "d:\gitrepositories\dsac-t\utils\initialization.py", line 58, in create_alg
    alg = alg_cls(**kwargs)
  File "d:\gitrepositories\dsac-t\dsac_v2.py", line 80, in __init__
    self.networks = ApproxContainer(**kwargs)
  File "d:\gitrepositories\dsac-t\dsac_v2.py", line 31, in __init__
    self.q1: nn.Module = create_apprfunc(**q_args)
  File "d:\gitrepositories\dsac-t\utils\initialization.py", line 82, in create_apprfunc
    apprfunc = apprfunc_cls(**kwargs)
  File "d:\gitrepositories\dsac-t\networks\mlp.py", line 115, in __init__
    [obs_dim + act_dim] + list(hidden_sizes) + [2],
TypeError: can only concatenate tuple (not "int") to tuple
drsssssss commented 5 months ago

Hi, since carracing is an image-input task, it is not appropriate to use MLP as an approximation function, we added a carracing-only training script ( dsac_cnn_carracing_offasync.py ) that uses CNN ( cnn.py ), and we also added a new A task variant of carracing, carracingraw (gym_carracingraw_data.py)

oowadanoko commented 5 months ago

Thank you, it works now, thanks a lot!