美文网首页
keras 模型执行完成后释放资源

keras 模型执行完成后释放资源

作者: 纵春水东流 | 来源:发表于2021-04-19 22:22 被阅读0次
import tensorflow as tf
import multiprocessing
import numpy as np
def run_tensorflow():
    code:

if __name__ == "__main__":

    # option 1: execute code with extra process
    p = multiprocessing.Process(target=run_tensorflow)
    p.start()
    p.join()

    # wait until user presses enter key
    raw_input()

    # option 2: just execute the function
    run_tensorflow()

    # wait until user presses enter key
    raw_input()

相关文章

网友评论

      本文标题:keras 模型执行完成后释放资源

      本文链接:https://www.haomeiwen.com/subject/jygwlltx.html