0

I have a problem with Keras and multiprocessing. I have already searched a lot and I found a lot of questions with the same subjects:

(and lot more)

I tried these solutions, so basically importing Keras after the multiprocessing has been instantiated. In actual fact, I see this message:

Using TensorFlow backend.
Using TensorFlow backend.
Using TensorFlow backend.
Using TensorFlow backend.
Using TensorFlow backend.
Using TensorFlow backend.
Using TensorFlow backend.
Using TensorFlow backend.
Using TensorFlow backend.
Using TensorFlow backend. 

Before this message was only printed one time, so I assume that the backend is different, however, my processes are running on the same core. If run again the main process, it creates more processes that run in the same processor as well. It seems that something blocks the execution on different processors.

Any idea on how to fix it?

PS: I am using the second solution I have linked, in particular the following :

DO NOT LOAD KERAS TO YOUR MAIN ENVIRONMENT
Guido Muscioni
  • 1,203
  • 3
  • 15
  • 37

1 Answers1

0

The problem was in the installation of tensorflow and keras. The methods for achieving parallelization are correct.

The tensorflow documentation clearly states that is highly suggested to install the package using pip as the conda package is maintained only by the community (https://www.tensorflow.org/install/pip).

I fixed the problem uninstalling keras and tensorflow and reinstalling them with:

pip install tensorflow
pip install keras
Guido Muscioni
  • 1,203
  • 3
  • 15
  • 37