I would like to train several different models using model.fit () in parallel in the same python application. The models used do not necessarily have something in common, they run in the same application at different times.
First, I run one model.fit () without problems in a separate thread, and then in the main thread. If now I want to run the second model.fit (), I get the following error message:
Exception in thread Thread-1: tensorflow.python.framework.errors_impl.InvalidArgumentError: Node 'hidden_1/BiasAdd': Unknown input node 'hidden_1/MatMul'
Both of them begin with a method along the same lines of code:
start_learn(self:) tf_session = K.get_session()
Th called class / method is as follows:
def run(self): tf_session = self.tf_session
I think I somehow need to assign a new tf_session and a new tf_graph for each individual thread. But I'm not quite sure about that. I would be happy with every short idea, as I sit on it for too long.
thanks
source share