When you set the parameters of the mobilenet to have no gradient the backward function cannot be calculated because there is nothing to calculate it with. Are you trying to freeze the mobilenet layers? If so there is a better way to do that. When you define your optimizer only put in the parameters you want like this:
optimizer  = optim.Adam(mobilenetv3.fc.parameters())

that will only update the fc parameters.