Thank you!
It makes sense. However, I am wondering why replacing torch.utils.tensorboard to tensorboardX will make the code work?
I usually set os.environ after args are parsed since gpu is specified in args, which is typically after pakages are imported.