Benny Benny - 2 years ago 191
Python Question

Pybrains Maze tutorial gets Error

I am trying to do Maze question by using pybrains
here is my question:
I followed the tutorial and run example

envmatrix = [[...]]
env = Maze(envmatrix, (1, 8))
task = MDPMazeTask(env)
table = ActionValueTable(states_nr, actions_nr)
learner = Q()
agent = LearningAgent(table, learner)
experiment = Experiment(task, agent)

when I run and showed

assert self.lastobs != None
FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.

Could anyone helps me?
Thanks a lot

Answer Source

To avoid this specific warning I would suggest using numpy.not_equal:

np.not_equal(self.lastobs, None)

Anyway the problem arises from the fact that you are comparing a list of objects with None which will cause an element-wise comparison (each object will be compared with None in turn). This is it's warning you about. You can also ignore it.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download