balance-bot icon indicating copy to clipboard operation
balance-bot copied to clipboard

Module baseline.deepq.models has no attribute mlp

Open gitndlaity opened this issue 5 years ago • 3 comments

Hello, What can we do in that case Thank You Screenshot from 2020-04-25 15-59-38

gitndlaity avatar Apr 25 '20 08:04 gitndlaity

import gym from baselines import deepq import balance_bot

def callback(lcl, glb): # stop training if reward exceeds 199 #is_solved = lcl['t'] > 100 and sum(lcl['episode_rewards'][-101:-1]) / 100 >= 199 is_solved = lcl['episode_rewards'][-1] >= 10 print('\r Current Score {} current status {}'.format(lcl['episode_rewards'][-1], is_solved),end=' ') return is_solved

def main(): # create the environment env = gym.make("balancebot-v0") # <-- this we need to create

# create the learning agent
#model = deepq.models.mlp([16, 16])

# train the agent on the environment
act = deepq.learn(
    env, network='mlp', lr=1e-3,
    total_timesteps=200000, buffer_size=50000, exploration_fraction=0.5,
    exploration_final_eps=0.02, print_freq=5, callback=callback
)

# save trained model
act.save("balance.pkl")

if name == 'main': main()

akashkmr27089 avatar May 09 '20 06:05 akashkmr27089

comment model = deepq.models.mlp([16, 16]) and assign network parameter to 'mlp' and change to total_timesteps according to new update gym environment

akashkmr27089 avatar May 09 '20 06:05 akashkmr27089

Thanks, Sir it's working very well.

Le sam. 9 mai 2020 à 14:52, Aakash Kumar [email protected] a écrit :

comment model = deepq.models.mlp([16, 16]) and assign network parameter to 'mlp' and change to total_timesteps according to new update gym environment

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yconst/balance-bot/issues/2#issuecomment-626117659, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL5YPU4ZLNDUFVXM52SKFCLRQT4ULANCNFSM4MQUQZOQ .

-- Merci cordialemt

gitndlaity avatar May 14 '20 10:05 gitndlaity