Open Taylor-Tian opened 5 years ago
Hi @Taylor-Tian ,
Thanks for your question. Sorry for the delay, I just got back from vacation.
In TF 1.x a session can only execute one graph. All the operations you ask it to run must come from that one graph. If you ask it to execute an operation that belongs to any other graph, it raises the exception you got. Since the stacktrace shows that the error took place on the line init.run()
, we can deduce that the init
operation does not belong to the current session's graph.
The init
operation is created in cell [62], and it belongs to the default graph (since there is no 'with graph.as_default()block). Moreover, the
Sessionis created without any
graphas argument, meaning it uses the default graph. So the operation's graph _should_ be the same as the session's graph, i.e., the default graph. So the only explanation I can see is that you reset the graph after creating the
initoperation. In that case, the
init` operation would belong to the old default graph, while the session would use the new default graph.
So please ensure that:
I hope this helps, Aurélien
Can anyone talk to me how to solve this problem?