python mpi4py 读取json_用mpi4py实现分布式学习

mpi_learn

Distributed learning with mpi4py

Dependencies: OpenMPI and mpi4py (v. >= 2.0.0), keras (v. >= 1.2.0)

Test with the MNIST dataset:

git clone https://github.com/duanders/mpi_learn.git

cd mpi_learn

python BuildModel.py mnist

python models/get_mnist.py

mpirun -np 3 ./MPIDriver.py mnist_arch.json train_mnist.list test_mnist.list --loss categorical_crossentropy --epochs 3

Using MPIDriver.py to train your model

MPIDriver.py will load a keras model of your choice and train it on the input data you provide. The script has three required arguments:

Path to JSON file specifying the Keras model (your model can be converted to JSON using the model's to_json() method)

File containing a list of training data. This should be a simple text file with one input data file per line. By default the script expects data stored in HDF5 format; see below for instructions for handling arbitrary input data.

File containing a list of validation data. This should be a simple text file with one input data file per line.

See MPIDriver.py for supported optional arguments. Run the script via mpirun or mpiexec. It should automatically detect available NVIDIA GPUs

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值