The Wayback Machine - https://web.archive.org/web/20220411175840/https://github.com/SciSharp/TensorFlow.NET/issues/314
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tf.summary.FileWriter #314

Open
AndyZap opened this issue Jul 25, 2019 · 5 comments
Open

tf.summary.FileWriter #314

AndyZap opened this issue Jul 25, 2019 · 5 comments
Assignees
Labels
enhancement good first issue

Comments

@AndyZap
Copy link

@AndyZap AndyZap commented Jul 25, 2019

Hi - I would like to save graph for visualisation in tensorboard. Tried to use tf.summary.FileWriter, but it does not generate any file. Please could you check - was it my mistake, or tf.summary is not supported? This is in the code sample below, 3)

Also a general question which method to use to save the graph. I have found 4 methods - see the code sample below. Seems that in this project you prefer 4) (meta). What are the difference, which one would you recommend?

var a = tf.Variable(10, name : "a");
var b = tf.Variable(5, name : "b");

var mult = tf.multiply(a, b);

var init = tf.global_variables_initializer();

var saver = tf.train.Saver();
var mult_summary = tf.summary.scalar("mult", mult);

with(tf.Session(), sess =>
{
   sess.run(init);
   var result = sess.run(new object[] { mult } );
   Console.WriteLine(result[0].ToString());

   // 1)
   saver.save(sess, "./Saver");

   // 2)
   tf.train.write_graph(sess.graph, ".", "write_graph.pb", as_text:false);

   // 3)
   var file_writer = tf.summary.FileWriter(".", sess.graph);
   file_writer.add_summary(result[0].ToString());

   // 4)
   tf.train.export_meta_graph(".\export_meta_graph.meta", as_text:false);
});
@Oceania2018
Copy link
Member

@Oceania2018 Oceania2018 commented Jul 25, 2019

@AndyZap Depends on what the purpose is. The behavior should be same as python wrapper. If not, please raise issue seperately.

@Oceania2018 Oceania2018 added the good first issue label Jul 25, 2019
@Oceania2018 Oceania2018 added this to Needs triage in TensorFlow.Binding via automation Jul 26, 2019
@Oceania2018 Oceania2018 added the enhancement label Jul 31, 2019
@Oceania2018 Oceania2018 self-assigned this Jul 31, 2019
@blct-w
Copy link

@blct-w blct-w commented Mar 10, 2020

I have the same problem. tf.summary.FileWriter has no reaction except to generate a folder. Waiting for some relevant updates.

@TianYangTang
Copy link

@TianYangTang TianYangTang commented Oct 4, 2020

Same issues here
I got the following error, with same environment, my another PC running Windows 10 can produce log file without any hassars.

Error message
T:\src\github\tensorflow\tensorflow\core\util\events_writer.cc:104] Write failed because file could not be opened.
image

@Oceania2018
Copy link
Member

@Oceania2018 Oceania2018 commented Oct 4, 2020

This function is still in to-do list.

@x-DataError-x
Copy link

@x-DataError-x x-DataError-x commented Feb 14, 2022

// 3)
might want to throw in:
catch (IOException e)
Console.WriteLine("ERROR: {e.Message}");
or something similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue
Projects
TensorFlow.Binding
  
Needs triage
Development

No branches or pull requests

5 participants