{"action":"created","issue":{"url":"https://api.github.com/repos/openai/baselines/issues/658","repository_url":"https://api.github.com/repos/openai/baselines","labels_url":"https://api.github.com/repos/openai/baselines/issues/658/labels{/name}","comments_url":"https://api.github.com/repos/openai/baselines/issues/658/comments","events_url":"https://api.github.com/repos/openai/baselines/issues/658/events","html_url":"https://github.com/openai/baselines/issues/658","id":371426007,"node_id":"MDU6SXNzdWUzNzE0MjYwMDc=","number":658,"title":"How to access the \"info\" that is generated during each env.step()","user":{"login":"cli0","id":25091717,"node_id":"MDQ6VXNlcjI1MDkxNzE3","avatar_url":"https://avatars3.githubusercontent.com/u/25091717?v=4","gravatar_id":"","url":"https://api.github.com/users/cli0","html_url":"https://github.com/cli0","followers_url":"https://api.github.com/users/cli0/followers","following_url":"https://api.github.com/users/cli0/following{/other_user}","gists_url":"https://api.github.com/users/cli0/gists{/gist_id}","starred_url":"https://api.github.com/users/cli0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cli0/subscriptions","organizations_url":"https://api.github.com/users/cli0/orgs","repos_url":"https://api.github.com/users/cli0/repos","events_url":"https://api.github.com/users/cli0/events{/privacy}","received_events_url":"https://api.github.com/users/cli0/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-18T08:54:20Z","updated_at":"2018-10-18T23:50:41Z","closed_at":null,"author_association":"NONE","body":"I have programmed my environment to provide some additional information in the info field and now I am training my agent using deepq. However, I don't see how to make my environment print the content of info in addition to the digest that I get (time spent exploring, mean average etc.) My code is like this:\r\n\r\n```\r\nenv = Monitor(env, log_dir, allow_early_resets=True)\r\n\r\nact = deepq.learn(\r\n    env=env,\r\n    network=\"mlp\",\r\n    total_timesteps=200000,\r\n    gamma=0.8,\r\n    prioritized_replay= True\r\n)\r\n```\r\n\r\nIs there a way to log environment info in the monitor.csv file?"},"comment":{"url":"https://api.github.com/repos/openai/baselines/issues/comments/431200852","html_url":"https://github.com/openai/baselines/issues/658#issuecomment-431200852","issue_url":"https://api.github.com/repos/openai/baselines/issues/658","id":431200852,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTIwMDg1Mg==","user":{"login":"pzhokhov","id":25395937,"node_id":"MDQ6VXNlcjI1Mzk1OTM3","avatar_url":"https://avatars0.githubusercontent.com/u/25395937?v=4","gravatar_id":"","url":"https://api.github.com/users/pzhokhov","html_url":"https://github.com/pzhokhov","followers_url":"https://api.github.com/users/pzhokhov/followers","following_url":"https://api.github.com/users/pzhokhov/following{/other_user}","gists_url":"https://api.github.com/users/pzhokhov/gists{/gist_id}","starred_url":"https://api.github.com/users/pzhokhov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pzhokhov/subscriptions","organizations_url":"https://api.github.com/users/pzhokhov/orgs","repos_url":"https://api.github.com/users/pzhokhov/repos","events_url":"https://api.github.com/users/pzhokhov/events{/privacy}","received_events_url":"https://api.github.com/users/pzhokhov/received_events","type":"User","site_admin":false},"created_at":"2018-10-18T23:50:41Z","updated_at":"2018-10-18T23:50:41Z","author_association":"COLLABORATOR","body":"Hi @cli0! Current implementation of deepq does not make use of info dict that is generated by env.step() - it is discaded, specifically here: https://github.com/openai/baselines/blob/fc7f9cec49786d50bb635228da0062972bdcf967/baselines/deepq/deepq.py#L284\r\n\r\nf you want that info to be saved into monitor.csv, you can modify the code in baselines/bench/monitor.py (note that each line in that file corresponds to a complete episode rather than a single step). If you want the data to be printed to the screen into the summary, you can modify the deepq code (the line above and section around logging https://github.com/openai/baselines/blob/fc7f9cec49786d50bb635228da0062972bdcf967/baselines/deepq/deepq.py#L314) to add your stats of interest to the logger (this way, stats can be printed out, saved as a csv and in tensorboard format). \r\nThe difference in how various algos interact with info dict is indeed a bit annoying; and unifying it is a good idea, but it is not very high up on our todo list. \r\nHope this helps and closing it, feel free to reopen if something does not work out. "}}
{"actor":{"display_login":"pzhokhov"}}