Ideally you should be running it after model.train(), but in this case there shouldn’t be any problem. I suppose the model.net.fc call should exist, if it does, I suspect the backward() call isn’t affecting the fc layer. Since your first code does work, I suspect you’re trying to access the classification module with the wrong name(fc in this case).