text: Title: Can't record scalars when the training is going
  Body: Hi all, I met a problem with tensorboardX in my computer. When the code is as follows:
  ```python
  train_sr_loss = train(training_data_loader, optimizer, model, scheduler, l1_criterion, epoch, args)
  writer.add_scalar("scalar/Train_sr_loss", train_sr_loss.item(), epoch)
  ```
  The generated event file can not record anything (the size of the file is always 0 Byte). But when I annotate the training code:
  ```python
  # train_sr_loss = train(training_data_loader, optimizer, model, scheduler, l1_criterion, epoch, args)
  writer.add_scalar("scalar/Train_sr_loss", train_sr_loss.item(), epoch)
  ```
  The event file can record scalars now. Does anyone know what's happening here? It happens suddenly and I have no idea what's wrong with my computer. BTW, when I use other computers, it works.
  The environment of my computer:
  **pytorch 1.0.0
  tensorboard 1.14.0
  tensorboardX 1.8**
  The environment of the other computer which works with the former code:
  **pytorch 1.0.1
  tensorboardX 1.6**
  Thanks for your help~