Could you try to check the gradients by printing them (i.e. without TensorBoard) just for the same of debugging?
To do so, you could iterate the parameters using this code snippet:
for name, param in model.named_parameters():
    print(name, param.grad)

If some param.grad attributes are returning None, then the computation graph is indeed detached (and I cannot find the line of code where this is happening  ).