The last error is raised, since the .grad attribute is still set to None.
This might be the case, if you are trying to check the gradients before they were calculated in the first backward() operation.