api_train.py 348 字节
Newer Older
Y
Yu Yang 已提交
1 2 3 4 5 6 7 8 9 10 11 12
import py_paddle.swig_paddle as api
from paddle.trainer.config_parser import parse_config


def main():
    api.initPaddle("-use_gpu=false", "-trainer_count=4")  # use 4 cpu cores
    config = parse_config('simple_mnist_network.py', '')
    m = api.GradientMachine.createFromConfigProto(config.model_config)


if __name__ == '__main__':
    main()