PyTorch-NEAT icon indicating copy to clipboard operation
PyTorch-NEAT copied to clipboard

Exception: Failed to activate node delta_w

Open steviestevepy opened this issue 4 years ago • 1 comments

Currently running the adaptive HyperNEAT example using device = "cuda:0"

Population size: 100 Elitism: 10% No multiprocessing

It runs okay for several generations, up until the following exception is thrown from the cppn.py Any help to sort out this issue is appreciated.

 File "/pytorch_neat/cppn.py", line 108, in __call__
    return self.get_activs(shape)
  File "/pytorch_neat/cppn.py", line 93, in get_activs
    self.activs = self.activate(xs, shape)
  File "/pytorch_neat/cppn.py", line 87, in activate
    raise Exception("Failed to activate node {}".format(self.name))
Exception: Failed to activate node delta_w

steviestevepy avatar Feb 02 '21 21:02 steviestevepy

Additional info on Traceback : RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!

Could this be because self.aggregation(inputs) is not correctly implemented for cuda:0 device?

Traceback (most recent call last):
  File "/pytorch_neat/cppn.py", line 83, in activate
    pre_activs = self.aggregation(inputs)
  File "/pytorch_neat/aggregations.py", line 20, in sum_aggregation
    return sum(inputs)
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!

Thank you in advance.

steviestevepy avatar Feb 02 '21 21:02 steviestevepy