rotem154154 / self-driving-car

teaching ai to drive a car
20 stars 10 forks source link

Error Vertex #3

Open OktavianPrabowo opened 5 years ago

OktavianPrabowo commented 5 years ago

I Have an error when i try your code

`TypeError Traceback (most recent call last)

in () 1 fps_display = FPSDisplay(window) 2 ----> 3 maps = CarMap() 4 ai = Ai() 5 net = Net() C:\WinPython\notebooks\Self Driving Car\Car_Map.py in __init__(self) 17 self.blue2 = [0, 97, 255, 1] * (2) 18 self.in_batch.add(len(self.in_map) / 2, pyglet.gl.GL_LINE_LOOP, None, ('v2i', self.in_map), ---> 19 ('c4B', self.in_grey * 4)) 20 self.out_batch.add(len(self.out_map) / 2, pyglet.gl.GL_LINE_LOOP, None, ('v2i', self.out_map), 21 ('c4B', self.out_grey * 4)) C:\WinPython\python-3.6.3.amd64\lib\site-packages\pyglet\graphics\__init__.py in add(self, count, mode, group, *data) 365 366 # Create vertex list and initialize --> 367 vlist = domain.create(count) 368 for i, array in initial_arrays: 369 vlist._set_attribute_data(i, array) C:\WinPython\python-3.6.3.amd64\lib\site-packages\pyglet\graphics\vertexdomain.py in create(self, count) 274 :rtype: `VertexList` 275 ''' --> 276 start = self._safe_alloc(count) 277 return VertexList(self, start, count) 278 C:\WinPython\python-3.6.3.amd64\lib\site-packages\pyglet\graphics\vertexdomain.py in _safe_alloc(self, count) 246 return self.allocator.alloc(count) 247 except allocation.AllocatorMemoryException as e: --> 248 capacity = _nearest_pow2(e.requested_capacity) 249 self._version += 1 250 for buffer, _ in self.buffer_attributes: C:\WinPython\python-3.6.3.amd64\lib\site-packages\pyglet\graphics\vertexdomain.py in _nearest_pow2(v) 82 # Credit: Sean Anderson 83 v -= 1 ---> 84 v |= v >> 1 85 v |= v >> 2 86 v |= v >> 4 TypeError: unsupported operand type(s) for >>: 'float' and 'int'` Can you help me to solve this problem??
OktavianPrabowo commented 5 years ago

Im using Python 3 by the way

rotem154154 commented 5 years ago

it's seems that python 2.7 fixes every error for me. please try it and then tell if it work :)