Pytorch Neural Network implementation issue(Optimizer got an empty parameter list)

I was implementing the Feed Forward Neural Network using pytorch nn.Sequential and nn.optim.I was having a issue in running the code as it is showing optimizer got an empty parameters list.somebody explain me why the issue is arising.

Try the following:

opt=optim.SGD(list(fn.parameters()), lr=1)

Here is the source for explanation.

Thanks a lot…Actually there was a small mistake in nn.Sequentail definition which resulted in the error…