You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tensor tf.Tensor 'softmax_tensor:0' shape=(-1,2) dtype=TF_FLOAT is not an element of this graph.
в Tensorflow.Graph._as_graph_element_locked(Object obj, Boolean allow_tensor, Boolean allow_operation)
в Tensorflow._ElementFetchMapper..ctor(Object[] fetches, Func`2 contraction_fn)
в Tensorflow._FetchMapper.for_fetch(Object fetch)
в Tensorflow._FetchHandler..ctor(Graph graph, Object fetches, Dictionary`2 feeds, Action feed_handles)
в Tensorflow.BaseSession._run(Object fetches, FeedItem[] feed_dict)
в Tensorflow.BaseSession.run(Tensor fetche, FeedItem[] feed_dict)
Because _ElementFetchMapper getting default graph:
We have been discussing multi-threading a lot lately,
When initializing a model - it has to be done from a single-thread because there are a lot of tf.* methods that access graph by getting the default.
You can later on use session.run(..) from multiple threads as Session class holds a reference to a graph internally.
In the near future we plan to make get_default_graph and get_default_session as thread-wide (right now it is process-wide).
We wanted that too but this will force the user to pass graph or session to every single tf.* call and as a result break the ability to easily port python code to C#.
@deadman2000, I've added support for multithreading in PR #371
It'll be released to nuget in a day or two as version 0.11.2.
You can read more in-depth details in our wiki here.
Activity
Nucs commentedon Aug 30, 2019
We have been discussing multi-threading a lot lately,
When initializing a model - it has to be done from a single-thread because there are a lot of
tf.*methods that access graph by getting the default.You can later on use
session.run(..)from multiple threads asSessionclass holds a reference to a graph internally.In the near future we plan to make
get_default_graphandget_default_sessionas thread-wide (right now it is process-wide).deadman2000 commentedon Aug 30, 2019
My suggestion is deprecate
get_default_graphandget_default_sessionNucs commentedon Aug 30, 2019
We wanted that too but this will force the user to pass graph or session to every single
tf.*call and as a result break the ability to easily port python code to C#.Oceania2018 commentedon Aug 30, 2019
Right, when users develop a model or training model, they want to share some global variables. It’s hard to change at this moment.
Nucs commentedon Aug 31, 2019
@deadman2000, I've added support for multithreading in PR #371
It'll be released to nuget in a day or two as version 0.11.2.
You can read more in-depth details in our wiki here.