[Solved] Pytorch 0.3.0 Adam Error: 'function' object has no attribute 'parameters'

I started using pytorch recently, I’m forced to use version 0.3.0, I created a network that works on CPU, now I would like to try on GPU, I read in the documentation that I should use " model.to (device) ", device for example cuda: 0, but this gave me an error " MyModel: object has no attribute to ", so I tried like this:

model = MyNet(N_CHANNEL, H_STATE, N_LAYERS, BIDIRECTIONAL, N_CATEGORIES).cuda
optimizer = torch.optim.Adam(model.parameters(), lr=LEARNING_RATE)

But I can not fix this error:
AttributeError: 'function' object has no attribute 'parameters'

Can someone help me?
Thank you

.cuda() is a function. Therefore you have to use parenthesis.

Thank you so much, a simple error that was making me crazy.
Now the network starts on a TITAN PASCAL GPU, suggestions on the num_workers to be set in the Dataloader?
Thank you.

Good to hear!
num_workers depends on your CPU and probably your i/o throughput. Start with the number of cores and try different values around it. The Imagenet example uses code to time the data loading time which might be useful for you.

Ok, thank you so much.