Giter VIP home page Giter VIP logo

google_dopamine_live's Issues

TypeError: create_basic_agent() got an unexpected keyword argument 'summary_writer'

Hello,

I am testing this code in a local installation of dopamine, my script is almost verbatim what is listed here but upon running the code, I get the following error.

I did some googling and found that summary_writer may be depreciated:
"tf.train.SummaryWriter is deprecated, instead use tf.summary.FileWriter"

However I'm not quite sure if this is the case in this instance, or if so where/how to indicate that 'FileWriter' should be used instead of 'SummaryWriter'. Wondering if anyone can take a look.

OS: Ubuntu 18.04.1, Tensorflow has been updated to 1.10.* and all other dependencies are installed/tested working (as far as I know. I was able to successfully execute the Atari training example in the dopamine documentation).

Thanks!

Error:

filip@FWS:~/dopamine/tests$ sudo python ./dopamineStream.py
2018-09-22 18:36:59.252144: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Traceback (most recent call last):
  File "./dopamineStream.py", line 12, in <module>
    class BasicAgent(object):
  File "./dopamineStream.py", line 43, in BasicAgent
    basic_runner = run_experiment.Runner(LOG_PATH, create_basic_agent, game_name=GAME, num_iterations=200, training_steps=10, evaluation_steps=10, max_steps_per_episode=100)
  File "/usr/local/lib/python2.7/dist-packages/gin/config.py", line 1032, in wrapper
    utils.augment_exception_message_and_reraise(e, err_str)
  File "/usr/local/lib/python2.7/dist-packages/gin/utils.py", line 50, in augment_exception_message_and_reraise
    six.reraise(proxy, None, sys.exc_info()[2])
  File "/usr/local/lib/python2.7/dist-packages/gin/config.py", line 1009, in wrapper
    return fn(*new_args, **new_kwargs)
  File "/home/filip/dopamine/dopamine/atari/run_experiment.py", line 164, in __init__
    summary_writer=self._summary_writer)
TypeError: create_basic_agent() got an unexpected keyword argument 'summary_writer'
  In call to configurable 'Runner' (<unbound method Runner.__init__>)

Here is the script:

import numpy as np
import os
from dopamine.agents.dqn import dqn_agent
from dopamine.atari import run_experiment
from dopamine.colab import utils as colab_utils
from absl import flags

BASE_PATH = '/tmp/colab_dope_run'
GAME = 'Asterix'
LOG_PATH = os.path.join(BASE_PATH, 'basic_agent', GAME)

class BasicAgent(object):
        def __init__(self, sess, num_actions, switch_prob=0.1):
                self._sess = sess
                self._num_actions = num_actions
                self._switch_prob = switch_prob 
                self._last_action = np.random.randint(num_actions)
                self.eval_mode = False

        def _choose_actions(self):
                if np.random.random() <= self._switch_prob:
                        self._last_action = np.random.randint(self._num_actions)
                return self._last_action

        def bundle_and_checkpoint(self, unused_checkpoint_dir, unused_iteration):
                pass

        def unbundle(self, unused_checkpoint_dir, unushed_checkpoint_version, unused_data):
                pass

        def begin_episode(self, unused_observation):
                pass

        def end_episode(self, unused_reward):
                pass

        def step(self, reward, observation):
                return self._choose_action()

        def create_basic_agent(sess, environment):
                return BasicAgent(sess, num_actions=environment.action_space.n, swit_prob=0.2)

basic_runner = run_experiment.Runner(LOG_PATH, create_basic_agent, game_name=GAME, num_iterations=200, training_steps=10, evaluation_steps=10, max_steps_per_episode=100)

print('Now training; this may take a while..')
basic_runner.run_experiement()
print('done training')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.