Commit f613c663 authored by Avisek Naug's avatar Avisek Naug 🎨
Browse files

fix tf init opt errors: initialize agent and lstm in main thread

parent 46cb51da
......@@ -419,7 +419,7 @@ if __name__ == '__main__':
# setting up environment and agent
env = Env()
env = Env(load_model(''))
agent = get_agent(env)'Initializing agent.')
......@@ -429,6 +429,11 @@ if __name__ == '__main__':
agent.test(env, nb_episodes=1, verbose=0, visualize=False,
nb_max_episode_steps=10)'MAIN THREAD: Creating empty LSTM model of energy consumption.')
lstm = createmodel()'MAIN THREAD: Initialize relearning agent with same environment')
re_agent = get_agent(env)
# setting up multi-threading structures for control/learning
signal_stop, signal_reload = Event(), Event()
lock_policy = Lock()
......@@ -474,7 +479,8 @@ if __name__ == '__main__':
learn_control(source=args.store_at, save_to=args.use_control,
duration=args.training_duration, signal_stop=signal_stop,
signal_reload=signal_reload, lock_policy=lock_policy)
signal_reload=signal_reload, lock_policy=lock_policy,
lstm=lstm, re_agent=re_agent)
end = time.perf_counter()
except KeyboardInterrupt:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment