Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
663 views
in Technique[技术] by (71.8m points)

machine-learning - 我该如何保存训练有素的强化学习代理以避免每次对其进行培训?(How can i save a trained reinforcement learning agent to avoid training it each time?)

I tried using pickle to save the tained agent

(我试着用泡菜来保存染色剂)

   try:
      agent1 = pickle.load(open(model_file_path, 'rb'))
    except:
      print("An exception occurred")
      train_agent(True)

    if agent1 == None:
        train_agent(True)

    human = Human()
    human.set_sym(env1.o)

    agent1.set_verbose(True)
    start_session(agent1, human, Environment(), draw=2)

    pickle.dump(agent1, open(model_file_path, 'wb')) 

    return agent1.prediction

But the file that saves the agent becomes very heavy approx 1gb, hence i am not able to resue the agent

(但是保存代理的文件变得非常沉重,大约1GB,因此我无法恢复代理)

  ask by Aparna translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...