You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered the error below. When building a model, one object in the model (a Node with a Conv2d process as output) could not be built due to the following error. Essentially, the object gets hashed to determine if it's in the builder's params, and because the Conv2d had non-contiguous filters in it, this failed.
My suggestion is to make params something that doesn't need to hash the objects, maybe our own WeakKeyIDDictionary. I'm not sure if this would have any adverse repercussions, but I can't think of any off the top of my head. It wouldn't work with pickling, since then things come back with different IDs, but I'm guessing that the builder doesn't work with pickling anyway.
/home/ehunsber/workspace/nengo/nengo/builder/builder.pycinbuild(cls, model, obj, *args, **kwargs)
202Theobjecttobuildintothemodel.
203"""--> 204 if model.has_built(obj): 205 # TODO: Prevent this at pre-build validation time. 206 warnings.warn("Object %s has already been built." % obj)/home/ehunsber/workspace/nengo/nengo/builder/builder.pyc in has_built(self, obj) 140 The object to query. 141 """-->142returnobjinself.params143144/home/ehunsber/workspace/nengo/nengo/params.pycin__hash__(self)
481def__hash__(self):
482returnhash((type(self), tuple(
-->483p.hashvalue(self) forpinself._params)))
484485def__getstate__(self):
/home/ehunsber/workspace/nengo/nengo/params.pycin<genexpr>((p,))
481def__hash__(self):
482returnhash((type(self), tuple(
-->483p.hashvalue(self) forpinself._params)))
484485def__getstate__(self):
/home/ehunsber/workspace/nengo/nengo/params.pycinhashvalue(self, instance)
360361defhashvalue(self, instance):
-->362returnarray_hash(self.__get__(instance, None))
363364defvalidate(self, instance, ndarray): # noqa: C901/home/ehunsber/workspace/nengo/nengo/utils/numpy.pycinarray_hash(a, n)
72v=a.view()
73v.setflags(write=False)
--->74returnhash(v.dataifPY2elsev.data.tobytes())
75else:
76# pick random elements to hashAttributeError: cannotgetsingle-segmentbufferfordiscontiguousarray
The text was updated successfully, but these errors were encountered:
I've encountered the error below. When building a model, one object in the model (a Node with a Conv2d process as output) could not be built due to the following error. Essentially, the object gets hashed to determine if it's in the builder's
params
, and because the Conv2d had non-contiguous filters in it, this failed.My suggestion is to make
params
something that doesn't need to hash the objects, maybe our ownWeakKeyIDDictionary
. I'm not sure if this would have any adverse repercussions, but I can't think of any off the top of my head. It wouldn't work with pickling, since then things come back with different IDs, but I'm guessing that the builder doesn't work with pickling anyway.The text was updated successfully, but these errors were encountered: