tensorboard-aggregator icon indicating copy to clipboard operation
tensorboard-aggregator copied to clipboard

Tensorflow Migration Issues

Open MichielProost opened this issue 3 years ago • 2 comments

Dear creators of this repository,

I wanted to use this tool for my master's thesis, but I experienced some migration issues related to Tensorflow. The issues occured in the function 'write_summary'. I only wanted to generate a tensorboard summary, so these issues might occur in other places of the code as well.

I used this code to fix the issues:

def write_summary(dpath, aggregations_per_key):
    writer = tf.summary.create_file_writer(str(dpath))

    for key, (steps, wall_times, aggregations) in aggregations_per_key.items():
        for step, wall_time, aggregation in zip(steps, wall_times, aggregations):
            with writer.as_default():
                tf.summary.scalar(key, aggregation, step=step)
                writer.flush()

I am definitely not experienced in Tensorflow. I did a quick internet search and updated your code. I created this issue to make you aware of these migration issues, as well as to help other users with the same problems.

My versions: Pandas: 1.2.4 Numpy: 1.19.5 Tensorflow: 2.4.1 Tensorboard: 2.5.0

Have a great day. Cheers.

MichielProost avatar May 13 '21 12:05 MichielProost

I think that's right except writer.flush() should be outside the inner loop in favor of performance. Thanks for writing up the issue! It helped me :)

sunshineclt avatar Jun 22 '21 03:06 sunshineclt

@MichielProost Thanks for raising this issue. I currently do not find the time to address this. I will leave this issue open.

Spenhouet avatar Jun 22 '21 06:06 Spenhouet

@MichielProost should be fixed in PR #13 :)

Kenneth-Schroeder avatar Aug 24 '23 09:08 Kenneth-Schroeder

@Kenneth-Schroeder Thanks you for your help on this. @MichielProost Feel free to check out if this resolved your issue. Since the PR contained your suggested change, I'm expecting it to resolve your issue and are going to close it.

Spenhouet avatar Aug 24 '23 17:08 Spenhouet