在syft上使用keras训练联邦学习模型时,将不同系统上的工作人员作为客户端工作人员启动,在终端上执行特定的命令行。
python -m tf_encrypted.player --config /tmp/tfe.config client name此命令应在系统上执行,该系统是我的一个执行代码的客户端workers.when
(PySyft) C:\Users\mades>python -m tf_encrypted.player --config /tmp/tfe.config server1
Falling back to insecure randomness since the required custom op could not be found for the installed version of TensorFlow. Fix this by compiling custom ops. Missing file was 'C:\Users\mades\AppData\Roaming\Python\Python37\site-packages\tf_encrypted/operations/secure_random/secure_random_module_tf_1.15.2.so'
WARNING:tensorflow:From C:\Users\mades\AppData\Roaming\Python\Python37\site-packages\tf_encrypted\session.py:24: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.
Traceback (most recent call last):
File "C:\Users\mades\Anaconda3\envs\PySyft\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\mades\Anaconda3\envs\PySyft\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\mades\AppData\Roaming\Python\Python37\site-packages\tf_encrypted\player\__main__.py", line 22, in <module>
config = RemoteConfig.load(args.config)
File "C:\Users\mades\AppData\Roaming\Python\Python37\site-packages\tf_encrypted\config.py", line 221, in load
with open(filename, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tfe.config'如何为该系统上的联合学习准备配置文件?
发布于 2020-08-01 01:44:32
您不需要创建/tmp/tfe.config。集群启动时会自动创建。我的意思是当下面的命令被执行时。
cluster.start()假设你的集群是:
alice = sy.TFEWorker(host='192.168.1.120:4000', auto_managed=True)
bob = sy.TFEWorker(host='192.168.1.120:4001', auto_managed=True)
carol = sy.TFEWorker(host='192.168.1.120:4002', auto_managed=True)
cluster = sy.TFECluster(alice, bob, carol)
cluster.start()下面给出了/tmp/tfe.config的典型结构
{
"server0": "192.168.1.120:4000",
"server1": "192.168.1.120:4001",
"server2": "192.168.1.120:4002"
}现在,您可以在三个不同的会话中运行以下命令。
python -m tf_encrypted.player --config /tmp/tfe.config server0
python -m tf_encrypted.player --config /tmp/tfe.config server1
python -m tf_encrypted.player --config /tmp/tfe.config server2https://stackoverflow.com/questions/61520938
复制相似问题