loiccordone / object-detection-with-spiking-neural-networks

Repository code for the IJCNN 2022 paper "Object Detection with Spiking Neural Networks on Automotive Event Data"
MIT License
57 stars 12 forks source link

How to train on multi-GPUs #15

Closed xxyll closed 1 year ago

xxyll commented 1 year ago

Hi, I want to ask you that how can I modify the code to train it on two GPUs? I tried some methods on the net, but can't take effect.

Looking forward to your reply. Hope your work goes well~

loiccordone commented 1 year ago

Hi xxyll, To be honest I haven't tried to train with 2 GPUs, but PyTorch Lightning should allows it quite easily. You just have to specify gpus=[0, 1] in the Trainer method, in object_detection.py.

Let me know if you encounter errors when doing this.

xxyll commented 1 year ago

Sorry, the previous reply was accidentally deleted. I added a line of code to pl.Trainer in object_detection.py: ' accelerator='ddp',gpus=2,num_nodes=1 ' , ' accelerator="gpu", devices=[0,1] '. Either of the above two code is useful~