在集群环境中使用tensorflow会由于fork()/system()而产生错误

2024-06-10 20:18:36 发布

您现在位置:Python中文网/ 问答频道 /正文

我在集群环境中使用Keras和TensorFlow后端。 我没有在网络上做任何反向传播,只使用predict(...)layer.get_weights()和{}。在

我直接操作神经网络的参数,使用进化策略优化适应度函数。在

我有一个主程序,生成N个参数集(权重和偏差),然后使用MPI传递给工人。为此,我使用mpi4py。然后,这些工作者在他们自己的序列模型(keras)实例上设置这些参数,并通过利用该网络预测行为来评估适应度函数。然后将适应度传回主控制器,主控制器适应从中采样的参数集的分布。在

运行代码时,我收到以下警告:

An MPI process has executed an operation involving a call to the fork() system call to create a child process. Open MPI is currently operating in a condition that could result in memory corruption or other system errors; your MPI job may hang, crash, or produce silent data corruption. The use of fork() (or system() or other calls that create child processes) is strongly discouraged.

我实现了一个没有keras/tensorflow的算法版本,错误消失了。一、 因此,请相信tensorflow正在执行system()或{}调用。有没有可能阻止tensorflow进行这种调用?在


Tags: orto函数网络参数tensorflowcreate控制器