I used to have this problem. I had difficult time  to figure it out first. when I started looking deep into Model. I figure out that my forward function in the class  was defined inside the init function. May be this could be the reason for your problem too.