{"action":"created","issue":{"url":"https://api.github.com/repos/ugo-nama-kun/DQN-chainer/issues/3","repository_url":"https://api.github.com/repos/ugo-nama-kun/DQN-chainer","labels_url":"https://api.github.com/repos/ugo-nama-kun/DQN-chainer/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/ugo-nama-kun/DQN-chainer/issues/3/comments","events_url":"https://api.github.com/repos/ugo-nama-kun/DQN-chainer/issues/3/events","html_url":"https://github.com/ugo-nama-kun/DQN-chainer/issues/3","id":142702319,"number":3,"title":"Implementation for CPU","user":{"login":"brgyk","id":16172289,"avatar_url":"https://avatars.githubusercontent.com/u/16172289?v=3","gravatar_id":"","url":"https://api.github.com/users/brgyk","html_url":"https://github.com/brgyk","followers_url":"https://api.github.com/users/brgyk/followers","following_url":"https://api.github.com/users/brgyk/following{/other_user}","gists_url":"https://api.github.com/users/brgyk/gists{/gist_id}","starred_url":"https://api.github.com/users/brgyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brgyk/subscriptions","organizations_url":"https://api.github.com/users/brgyk/orgs","repos_url":"https://api.github.com/users/brgyk/repos","events_url":"https://api.github.com/users/brgyk/events{/privacy}","received_events_url":"https://api.github.com/users/brgyk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-22T16:24:13Z","updated_at":"2016-03-27T09:55:34Z","closed_at":"2016-03-27T09:55:34Z","body":"Hello, ugo-nama-kun,\r\n\r\nThank you very much for your great code of DQN in chainer.\r\nIt helps my research.\r\nI would like to get suggestion to change CPU implementation.\r\n\r\nAccording to my understanding, CuPy has compatibility for NumPy so that I just remove to_gpu() method from your code. However that code cause error as follows.\r\nSo far I am not sure this is limitation of CuPy or my misunderstanding.\r\nCould you please suggest about this issue?\r\n\r\n=== Error when it remove to_gpu() method from the code ===\r\n  File \"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/rlglue/agent/ClientAgent.py\", line 51, in onAgentStart\r\n    action = self.agent.agent_start(observation)\r\n  File \"dqn_agent_nature_cpu.py\", line 216, in agent_start\r\n    action, Q_now = self.DQN.e_greedy(state_, self.epsilon)\r\n  File \"dqn_agent_nature_cpu.py\", line 167, in e_greedy\r\n    Q = self.Q_func(s)\r\n  File \"dqn_agent_nature_cpu.py\", line 144, in Q_func\r\n    h1 = F.relu(self.model.l1(state / 254.0))  # scale inputs in [0.0 1.0]\r\n  File \"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/chainer-1.3.0-py2.7.egg/chainer/function.py\", line 174, in __call__\r\n    outputs = self.forward(in_data)\r\n  File \"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/chainer-1.3.0-py2.7.egg/chainer/function.py\", line 238, in forward\r\n    return self.forward_cpu(inputs)\r\n  File \"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/chainer-1.3.0-py2.7.egg/chainer/functions/connection/convolution_2d.py\", line 165, in forward_cpu\r\n    y = numpy.tensordot(self.col, self.W, ((1, 2, 3), (1, 2, 3)))\r\n  File \"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/numeric.py\", line 1284, in tensordot\r\n    a, b = asarray(a), asarray(b)\r\n  File \"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/numeric.py\", line 474, in asarray\r\n    return array(a, dtype, copy=False, order=order)\r\nValueError: object __array__ method not producing an array\r\n\r\nThanks,\r\nbrgyk."},"comment":{"url":"https://api.github.com/repos/ugo-nama-kun/DQN-chainer/issues/comments/202030831","html_url":"https://github.com/ugo-nama-kun/DQN-chainer/issues/3#issuecomment-202030831","issue_url":"https://api.github.com/repos/ugo-nama-kun/DQN-chainer/issues/3","id":202030831,"user":{"login":"brgyk","id":16172289,"avatar_url":"https://avatars.githubusercontent.com/u/16172289?v=3","gravatar_id":"","url":"https://api.github.com/users/brgyk","html_url":"https://github.com/brgyk","followers_url":"https://api.github.com/users/brgyk/followers","following_url":"https://api.github.com/users/brgyk/following{/other_user}","gists_url":"https://api.github.com/users/brgyk/gists{/gist_id}","starred_url":"https://api.github.com/users/brgyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brgyk/subscriptions","organizations_url":"https://api.github.com/users/brgyk/orgs","repos_url":"https://api.github.com/users/brgyk/repos","events_url":"https://api.github.com/users/brgyk/events{/privacy}","received_events_url":"https://api.github.com/users/brgyk/received_events","type":"User","site_admin":false},"created_at":"2016-03-27T09:55:34Z","updated_at":"2016-03-27T09:55:34Z","body":"Hello, ugo-nama-kun,\r\n\r\nI found mistake to handle ndarray and I confirmed it works correctly.\r\nLet me close this issue.\r\nThanks."}}