Hey guys,
I’m implementing some RL and got stuck at a, in my opinion, weird behaviour.
I’ll use DataParallel and the device-tag to move my Nets/ Data to the available device(s).
Using CPU and one CUDA device everything works fine, but if I use more than one device, I’ll get the following error:

File “_test_script.py”, line 229, in 
main()
File “_test_script.py”, line 177, in main
mae = ddpg.validate(states_val, labels_val, mean_train, std_train).item()
File “RL/DDPG/ddpg_linear_baseline.py”, line 415, in validate
forecast = self.actor_target(state)
File “env/lib/python3.5/site-packages/torch/nn/modules/module.py”, line 491, in call
result = self.forward(*input, **kwargs)
File “env/lib/python3.5/site-packages/torch/nn/parallel/data_parallel.py”, line 114, in forward
outputs = self.parallel_apply(replicas, inputs, kwargs)
File “env/lib/python3.5/site-packages/torch/nn/parallel/data_parallel.py”, line 124, in parallel_apply
return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)])
File “env/lib/python3.5/site-packages/torch/nn/parallel/parallel_apply.py”, line 65, in parallel_apply
raise output
File “env/lib/python3.5/site-packages/torch/nn/parallel/parallel_apply.py”, line 41, in _worker
output = module(*input, **kwargs)
File “env/lib/python3.5/site-packages/torch/nn/modules/module.py”, line 491, in call
result = self.forward(*input, **kwargs)
File “RL/Nets/actor/actor_linear_baseline.py”, line 28, in forward
x = F.relu(self.input_layer(x))
File “env/lib/python3.5/site-packages/torch/nn/modules/module.py”, line 491, in call
result = self.forward(*input, **kwargs)
File “env/lib/python3.5/site-packages/torch/nn/modules/linear.py”, line 55, in forward
return F.linear(input, self.weight, self.bias)
File "env/lib/python3.5/site-packages/torc
RuntimeError: size mismatch, m1: [1 x 144], m2: [288 x 256] at /pytorch/aten/src/THC/generic/THCTensorMathBlas.cu:249

The input layer of  actor_target is some simple linear layer:
self.input_layer = nn.Linear(288, 256)
I already checked the batch count, such that the data can be distributed evenly among the devices.
Does anyone know what I’m doing wrong?
Thanks!
Bene