Git Product home page Git Product logo

Comments (4)

redmouth avatar redmouth commented on September 21, 2024 9

you can try modifying function get_config(FLAGS) into following:

def get_config(FLAGS):
  if FLAGS.model == 'm1':
    config = M1
  # elif FLAGS.model == 'm2':
  #   config = M2

  # for k, v in FLAGS.__dict__['__flags'].items():
  for k, v in FLAGS.__flags.items():
    if k == 'use_gpu':
      if v.value == False:
        config.cnn_format = 'NHWC'
      else:
        config.cnn_format = 'NCHW'

    if hasattr(config, k):
      setattr(config, k, v.value)

  return config

from dqn-tensorflow.

dwsmith1983 avatar dwsmith1983 commented on September 21, 2024 3
  for k in FLAGS.__dict__['__wrapped']:
        if k == 'use_gpu':
            if not FLAGS.__getattr__(k):
                config.cnn_format = 'NHWC'
            else:
                config.cnn_format = 'NCHW'

    if hasattr(config, k):
        setattr(config, k, FLAGS.__getattr__(k))

With this change, I didn't get the memory error. However, there are still many bugs in the code for the new tensorflow.

from dqn-tensorflow.

jdmartin86 avatar jdmartin86 commented on September 21, 2024

Thanks for the response. After making your proposed update, I receive the following memory error.

Traceback (most recent call last):
  File "main.py", line 70, in <module>
    tf.app.run()
  File "/home/jdmartin86/anaconda2/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 126, in run
    _sys.exit(main(argv))
  File "main.py", line 62, in main
    agent = Agent(config, env, sess)
  File "/home/jdmartin86/sandbox/test-qlearn/DQN-tensorflow/dqn/agent.py", line 23, in __init__
    self.memory = ReplayMemory(self.config, self.model_dir)
  File "/home/jdmartin86/sandbox/test-qlearn/DQN-tensorflow/dqn/replay_memory.py", line 18, in __init__
    self.screens = np.empty((self.memory_size, config.screen_height, config.screen_width), dtype = np.float16)
MemoryError

Is this unrelated?

from dqn-tensorflow.

shelleyo9 avatar shelleyo9 commented on September 21, 2024

I met the same MemoryError problem as you, then I modify the memory_size in config.py to a smaller value and then it works. Hope this helps you.

from dqn-tensorflow.

Related Issues (20)

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.