fixed theano code not to depend on cv2