This repository contains unofficial code reproducing Agent57

Overview

Agent57

This repository contains unofficial code reproducing Agent57, which outperformed humans in all Atari games.

Directory File

  1. agent.py

    define agent to play a supecific environment.

  2. buffer.py

    define buffer to store experiences with priorites.

  3. learner.py

    define learner to update parameter such as q networks and functions related to intrinsic reward.

  4. main.py

    run the main pipeline.

  5. model.py

    define some models such as q network and functions related to intrinsic reward.

  6. segment_tree.py

    define segment tree which decide segment index according to the priority.

  7. tester.py

    define tester which test performance of Agent57.

  8. utils.py

    define some classes and functions such as UCB and Retrace operator.

Requirement

  • python==3.9.5

  • matplotlib==3.4.2

  • ray==1.4.1

  • lz4==3.1.3

  • numpy==1.21.0

  • omegaconf==2.1.1

  • torch==1.9.0

Installation

pip install -r requirements.txt

Usage

python main.py

Citation

Agent57: Outperforming the Atari Human Benchmark

https://arxiv.org/abs/2003.13350

You might also like...
Unofficial Medium Python Flask API and SDK
Unofficial Medium Python Flask API and SDK

PyMedium - Unofficial Medium API PyMedium is an unofficial Medium API written in python flask. It provides developers to access to user, post list and

(unofficial) Googletrans: Free and Unlimited Google translate API for Python. Translates totally free of charge.

Googletrans Googletrans is a free and unlimited python library that implemented Google Translate API. This uses the Google Translate Ajax API to make

An unofficial client library for Google Music.

gmusicapi: an unofficial API for Google Play Music gmusicapi allows control of Google Music with Python. from gmusicapi import Mobileclient api = Mob

Unofficial Python API client for Notion.so
Unofficial Python API client for Notion.so

notion-py Unofficial Python 3 client for Notion.so API v3. Object-oriented interface (mapping database tables to Python classes/attributes) Automatic

rewise is an unofficial wrapper for google search's auto-complete feature

rewise is an unofficial wrapper for google search's auto-complete feature

An Unofficial TikTok API Wrapper In Python

This is an unofficial api wrapper for TikTok.com in python. With this api you are able to call most trending and fetch specific user information as well as much more.

unofficial library for discord components(on development)

discord.py-buttons unofficial library for discord buttons(on development) Install pip install --upgrade discord_buttons Example from discord import Cl

✖️ Unofficial API of 1337x.to
✖️ Unofficial API of 1337x.to

✖️ Unofficial Python API Wrapper of 1337x This is the unofficial API of 1337x. It supports all proxies of 1337x and almost all functions of 1337x. You

Unofficial YooMoney API python library

API Yoomoney - unofficial python library This is an unofficial YooMoney API python library. Summary Introduction Features Installation Quick start Acc

Comments
  • RayOutOfMemoryError: More than 95% of the memory on node xxx is used

    RayOutOfMemoryError: More than 95% of the memory on node xxx is used

    Hello, thank you so much for the reproduction code!

    I have encountered RayOutOfMemoryError when running the code. To address this issue, I have tried set num_agents from the default of 16 to 8 and 4 respectively, but this address remains unsolved. I don't know if the other parameters (such as num_rollout and num_arms) should be changed together.

    My machine is a Linux server with 128GB of RAM and 4 2080-Ti GPUs. Could you please show me how to configure the parameters appropriately?

    Looking forward to your reply, thanks!

    opened by AptX395 1
  • cuDNN error: CUDNN_STATUS_EXECUTION_FAILED

    cuDNN error: CUDNN_STATUS_EXECUTION_FAILED

    I am trying to run your code on a fresh install of Ubuntu 20.04 with Python 3.9.5, and CUDA 11.6 / cuDNN 8.3.2, but when executing main.py the following cuDNN error results:

    $ python main.py 
    2022-01-21 16:02:17,793	INFO services.py:1272 -- View the Ray dashboard at http://127.0.0.1:8265
    (pid=36888) A.L.E: Arcade Learning Environment (version +978d2ce)
    (pid=36888) [Powered by Stella]
    (pid=36874) A.L.E: Arcade Learning Environment (version +978d2ce)
    (pid=36874) [Powered by Stella]
    (pid=36881) A.L.E: Arcade Learning Environment (version +978d2ce)
    (pid=36881) [Powered by Stella]
    (pid=36885) A.L.E: Arcade Learning Environment (version +978d2ce)
    (pid=36885) [Powered by Stella]
    (pid=36882) A.L.E: Arcade Learning Environment (version +978d2ce)
    (pid=36882) [Powered by Stella]
    (pid=36875) A.L.E: Arcade Learning Environment (version +978d2ce)
    (pid=36875) [Powered by Stella]
    ====================================================================================================
    Traceback (most recent call last):
      File "/home/nate/Desktop/Atom/agent57_pytorch/main.py", line 267, in <module>
        main(parser.parse_args())
      File "/home/nate/Desktop/Atom/agent57_pytorch/main.py", line 144, in main
        in_q_weight, ex_q_weight, embed_weight, trained_lifelong_weight, indices, priorities, in_q_loss, ex_q_loss, embed_loss, lifelong_loss = ray.get(finished_learner[0])
      File "/home/nate/miniconda3/lib/python3.9/site-packages/ray/_private/client_mode_hook.py", line 62, in wrapper
        return func(*args, **kwargs)
      File "/home/nate/miniconda3/lib/python3.9/site-packages/ray/worker.py", line 1495, in get
        raise value.as_instanceof_cause()
    ray.exceptions.RayTaskError(RuntimeError): ray::Learner.update_network() (pid=36888, ip=192.168.137.71)
      File "python/ray/_raylet.pyx", line 501, in ray._raylet.execute_task
      File "python/ray/_raylet.pyx", line 451, in ray._raylet.execute_task.function_executor
      File "/home/nate/miniconda3/lib/python3.9/site-packages/ray/_private/function_manager.py", line 563, in actor_method_executor
        return method(__ray_actor, *args, **kwargs)
      File "/home/nate/Desktop/Atom/agent57_pytorch/learner.py", line 262, in update_network
        priorities, in_q_loss, ex_q_loss = self.qnet_update(weights, segments)
      File "/home/nate/Desktop/Atom/agent57_pytorch/learner.py", line 308, in qnet_update
        ex_target_qvalues = self.get_qvalues(self.ex_target_q_network, ex_h0, ex_c0)
      File "/home/nate/Desktop/Atom/agent57_pytorch/learner.py", line 371, in get_qvalues
        _, (h, c) = q_network(self.states[t],
      File "/home/nate/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
        return forward_call(*input, **kwargs)
      File "/home/nate/Desktop/Atom/agent57_pytorch/model.py", line 99, in forward
        x, states = self.lstm(x.unsqueeze(0), states)
      File "/home/nate/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
        return forward_call(*input, **kwargs)
      File "/home/nate/miniconda3/lib/python3.9/site-packages/torch/nn/modules/rnn.py", line 679, in forward
        result = _VF.lstm(input, hx, self._flat_weights, self.bias, self.num_layers,
    RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED
    

    Have you encountered an error like this during development? Are you using an older version of CUDA / cuDNN? Please let me know if you have any suggestions. ​

    opened by Obliman 2
Owner
null
This repository contains code written in the AWS Cloud Development Kit (CDK)

This repository contains code written in the AWS Cloud Development Kit (CDK) which launches infrastructure across two different regions to demonstrate using AWS AppSync in a multi-region setup.

AWS Samples 5 Jun 3, 2022
This repository contains free labs for setting up an entire workflow and DevOps environment from a real-world perspective in AWS

DevOps-The-Hard-Way-AWS This tutorial contains a full, real-world solution for setting up an environment that is using DevOps technologies and practic

Mike Levan 1.6k Jan 5, 2023
This repository contains ready to deploy automations on AWS

aws-automation-plugins This repository contains ready to deploy automations on AWS. How-To All projects in this repository contain a deploy.sh file wh

Akesh Patil 8 Sep 20, 2022
This repository contains modules that extend / modify parts of Odoo ERP

Odoo Custom Addons This repository contains addons that extend / modify parts of Odoo ERP. Addons list account_cancel_permission Only shows the button

Daniel Luque 3 Dec 28, 2022
The unofficial Amazon search CLI & Python API

amzSear The unofficial Amazon Product CLI & API. Easily search the amazon product directory from the command line without the need for an Amazon API k

Asher Silvers 95 Nov 11, 2022
Unofficial Coinbase Python Library

Unofficial Coinbase Python Library Python Library for the Coinbase API for use with three legged oAuth2 and classic API key usage Version 0.3.0 Requir

George Sibble 104 Dec 1, 2022
An unofficial client library for Google Music.

gmusicapi: an unofficial API for Google Play Music gmusicapi allows control of Google Music with Python. from gmusicapi import Mobileclient api = Mob

Simon Weber 2.5k Dec 15, 2022
🔍 Google Search unofficial API for Python with no external dependencies

Python Google Search API Unofficial Google Search API for Python. It uses web scraping in the background and is compatible with both Python 2 and 3. W

Avi Aryan 204 Dec 28, 2022
Unofficial GoPro API Library for Python - connect to GoPro via WiFi.

GoPro API for Python Unofficial GoPro API Library for Python - connect to GoPro cameras via WiFi. Compatibility: HERO3 HERO3+ HERO4 (including HERO Se

Konrad Iturbe 1.3k Jan 1, 2023
Unofficial Python wrapper for official Hacker News API

haxor Unofficial Python wrapper for official Hacker News API. Installation pip install haxor Usage Import and initialization: from hackernews import H

null 147 Sep 18, 2022