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

I cannot get this to run.

Open paarthtandon opened this issue 4 years ago • 2 comments

I'm doing some research in continual learning, and a HyperNEAT implementation would come in handy. I have tried many things, and for the life of me I cannot get this implementation to run.

When I use a modern version of torch, I get IndexError: tensors used as indices must be long, byte or bool tensors after running the simple example.

I'm not sure if I can install pytorch 0.4.0, and even if I did I don't think this version supports CUDA.

Does anyone know if there is a way I can use this implementation, otherwise are there any other implementations of HyperNEAT I can use out there?

paarthtandon avatar Mar 27 '21 21:03 paarthtandon

You just need to change the types for the environment as it is expecting you to use one of the dtypes it mentions in the index error.

I solved this by modifying the recurrent_net.py, dense_from_coo method in line 37 to this:

mat[torch.tensor(rows, dtype=torch.long), torch.tensor(cols, dtype=torch.long)] = [right hand side stays the same] 

I did notice in there is an argument in each of the main.py files in the examples to put in the type (in the decorator). Right now it is set to an integer but might make sense to change it to float there, so as to not do the code modification I mentioned above. I havnt tested this yet though.

marctheshark3 avatar Aug 08 '22 15:08 marctheshark3

https://github.com/uber-research/PyTorch-NEAT/issues/2#issuecomment-486242119

This is the same error also and was solved in a similar manner.

marctheshark3 avatar Aug 08 '22 15:08 marctheshark3