Created
July 9, 2012 20:43
-
-
Save jni/3078772 to your computer and use it in GitHub Desktop.
Failure using @glouppe's cytomine scikit-learn RF shared memory implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [7]: rf = RandomForestClassifier(100, max_depth=20, n_jobs=8, shared=True, compute_importances=True) | |
In [8]: rf = rf.fit(dat5[0], dat5[1][:, 0]) | |
--------------------------------------------------------------------------- | |
OSError Traceback (most recent call last) | |
/groups/chklovskii/home/nuneziglesiasj/data/cropped_5um3_larva_fib_10x10x10nm/cl2/<ipython-input-8-16d0d527a259> in <module>() | |
----> 1 rf = rf.fit(dat5[0], dat5[1][:, 0]) | |
/groups/chklovskii/home/nuneziglesiasj/projects/scikit-learn-sharedmem/sklearn/ensemble/forest.pyc in fit(self, X, y) | |
273 # Pack inputs into shared-memory arrays | |
274 if self.shared: | |
--> 275 _X = shm.zeros(X.shape, X.dtype, "F") | |
276 _X[:] = X[:] | |
277 X = _X | |
/usr/lib64/python2.7/site-packages/sharedmem/array.pyc in shared_zeros(shape, dtype, order) | |
133 """ Create a shared-memory ndarray filled with 0s. | |
134 """ | |
--> 135 arr = shared_empty(shape, dtype, order) | |
136 x = np.zeros((), arr.dtype) | |
137 arr[...] = x | |
/usr/lib64/python2.7/site-packages/sharedmem/array.pyc in shared_empty(shape, dtype, order) | |
124 size = int(np.prod(shape)) | |
125 nbytes = size * dtype.itemsize | |
--> 126 wrapper = heap.BufferWrapper(nbytes) | |
127 strides = None | |
128 offset = 0 | |
/usr/lib64/python2.7/site-packages/sharedmem/heap.pyc in __init__(self, size) | |
64 def __init__(self, size): | |
65 self.size = size | |
---> 66 self.offset, self.buf = _heap.allocate(size) | |
67 | |
68 def __setstate__(self, _state): | |
/usr/lib64/python2.7/site-packages/sharedmem/heap.pyc in allocate(self, size) | |
51 with self.lock: | |
52 if size > mmap.PAGESIZE: | |
---> 53 offset, buf = self._allocate_big(size) | |
54 else: | |
55 offset, buf = self._allocate_tiny(size) | |
/usr/lib64/python2.7/site-packages/sharedmem/heap.pyc in _allocate_big(self, size) | |
43 | |
44 def _allocate_big(self, size): | |
---> 45 buf = SharedMemoryBuffer(size) | |
46 addr, _ = buf.getbuffer() | |
47 return 0, buf | |
/usr/lib64/python2.7/site-packages/sharedmem/sharedmemory_sysv.so in sharedmem.sharedmemory_sysv.SharedMemoryBuffer.__init__ (sharedmem/sharedmemory_sysv.c:1300)() | |
OSError: Failed to open shared memory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment