Hi!!!
I am looking for help because I have been stuck at this point for 3 days and I dont know what else to do.
I want to train a NN. In my code after all appropriate installations this error appears.
TypeError: unsupported operand type(s) for +: ‘int’ and ‘list’
I think that the code has no errors because I have find other similar codes in the internet and they did not have problem.
I believe that I dont have install the appropriate versions either from Python, either from Pytorch, something like that…
Can you help me identify and solve the problem?
My code:
def init(self, state_size, action_size, seed, fc1_units=400, fc2_units=300, use_bn=False):
print(type(fc1_units))
print(type(action_size))
“”“Initialize parameters and build model.”""
super(Critic, self).init()
self.seed = torch.manual_seed(seed)
self.use_bn = use_bn
self.fc1 = nn.Linear(state_size, fc1_units)
self.fc2 = nn.Linear(fc1_units + action_size, fc2_units)   ERROR
self.fc3 = nn.Linear(fc2_units, 1)
if self.use_bn:
self.bn1 = nn.BatchNorm1d(fc1_units)
self.bn2 = nn.BatchNorm1d(fc2_units)
    self.reset_parameters()

Error :
<class ‘int’>
<class ‘list’>
Traceback (most recent call last):
File “maddpg_trainer.py”, line 151, in 
main()
File “maddpg_trainer.py”, line 143, in main
agent = MADDPGAgentTrainer(state_shape, action_size, num_agents, writer=writer, random_seed=48, dirname=dirname, print_every=100, model_path=args.model)
File “C:\ML-Agents\Katorina\maddpg.py”, line 331, in init
for i in range(self.num_agents)]
File “C:\ML-Agents\Katorina\maddpg.py”, line 331, in 
for i in range(self.num_agents)]
File “C:\ML-Agents\Katorina\maddpg.py”, line 86, in init
random_seed, fc1_units=self.config[‘FC1’], fc2_units=self.config[‘FC2’]
File “C:\ML-Agents\Katorina\models.py”, line 87, in init
self.fc2 = nn.Linear(fc1_units + action_size, fc2_units)
TypeError: unsupported operand type(s) for +: ‘int’ and 'list’
Thank you in advance!