Spenhouet / tensorboard-aggregator

Aggregate multiple tensorboard runs to new summary or csv files
MIT License
166 stars 27 forks source link

Tensorflow Migration Issues #9

Closed MichielProost closed 1 year ago

MichielProost commented 3 years ago

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.

sunshineclt commented 3 years ago

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 :)

Spenhouet commented 3 years ago

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

Kenneth-Schroeder commented 1 year ago

@MichielProost should be fixed in PR #13 :)

Spenhouet commented 1 year ago

@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.