I solved the tensorboardX detected problem, just add a RUN_TIME_FLAG suffix with scalers key, like:
            writer.add_scalars(
                'data/scalar_group',
                {'source' + RUN_TIME_FLAG: losses[0],
                 'target' + RUN_TIME_FLAG: losses[1],
                 'transfer' + RUN_TIME_FLAG: losses[2],
                 'total' + RUN_TIME_FLAG: losses[3],
                 'advs' + RUN_TIME_FLAG: losses[4]}, i)

I tried the issue suggestion Detected out of order event.step when adding text after scalars with global_step #6 1 and both solution not work.