Keras.NET icon indicating copy to clipboard operation
Keras.NET copied to clipboard

console output in dotnet interactive jupyter notebook

Open ordinaryorange opened this issue 3 years ago • 1 comments

standard output when fitting the model does not show, nor does model.summary() when working in VSCode.

Is there a way to capture the std out ?

ordinaryorange avatar Jul 10 '22 13:07 ordinaryorange

I suspect this issue is more a pythonnet interop problem rather than a Keras.NET one. This hack keeps me moving forward

//insert before any Keras.NET code
PythonEngine.Initialize();
dynamic sys = Py.Import("sys");
var write = (string s) => Console.Write(s);
var flush = () => {}; 
sys.stdout = new {write = write, flush = flush };

ugly as, I'm all ears to better suggestions.

ordinaryorange avatar Jul 11 '22 03:07 ordinaryorange

Stale issue message

github-actions[bot] avatar May 03 '23 00:05 github-actions[bot]