Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CudaConvnetNetwork on PyTorch model #95

Open
MariamAlz opened this issue Aug 9, 2023 · 1 comment
Open

CudaConvnetNetwork on PyTorch model #95

MariamAlz opened this issue Aug 9, 2023 · 1 comment

Comments

@MariamAlz
Copy link

I'm trying to convert a pretrained PyTorch GAN model (generator) to spiking format using Nengo and NengoDL. I'm following the "CIFAR-10 classifier with a spiking CNN" tutorial from https://www.nengo.ai/nengo-extras/v0.5.0/examples/cuda_convnet/cifar10_spiking_cnn.html where I am using my model instead.

After running this line of code:

ccnet = CudaConvnetNetwork(netG_A2B_pkl, synapse=nengo.synapses.Alpha(0.005))

I get this error:

TypeError: 'Generator' object is not subscriptable

I'm using the netG_A2B model from here: https://github.com/yz-wang/Cycle-SNSPGAN

Any help or recommendations will be appreciated!

@hunse
Copy link
Collaborator

hunse commented Aug 23, 2023

CudaConvnetNetwork is a) pretty old code, and b) designed for importing networks created with the (now defunct) CudaConvnet library. It won't work for something from PyTorch. However, you could take inspiration from its design in writing your own class that can import PyTorch networks to Nengo. Unfortunately, we don't have a lot of support for PyTorch currently in the Nengo ecosystem (NengoDL has a "Keras converter" for importing from TensorFlow/Keras).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants