I have a list of 2215 molecules encoded as 2048 bit vectors. What I'm trying to do is to create 2D array from it. I am using rdkit
library to convert to numpy arrays. The code worked without a problem few weeks ago and now there is a memory error but I can't figure out why. Can anyone provide a solution?
I tried to make the list smaller and reduced it down to two vectors. I thought it would help but the error stills pops out after some time of processing. That leads me to believe that I in fact do have enough memory.
# red_fp is the list of bit vectors
def rdkit_numpy_convert(red_fp):
output = []
for f in fp:
arr = np.zeros((1,))
DataStructs.ConvertToNumpyArray(f, arr)
output.append(arr)
return np.asarray(output)
# this one line causes the problem
x = rdkit_numpy_convert(red_fp)
this is the error:
MemoryError Traceback (most recent call last)
MemoryError: cannot allocate memory for array
The above exception was the direct cause of the following exception:
SystemError Traceback (most recent call last)
<ipython-input-14-91594513666c> in <module>
----> 1 x = rdkit_numpy_convert(red_fp)
<ipython-input-13-78d1c9fdd07e> in rdkit_numpy_convert(red_fp)
4 for f in fp:
5 arr = np.zeros((1,))
----> 6 DataStructs.ConvertToNumpyArray(f, arr)
7 output.append(arr)
8 return np.asarray(output)
SystemError: <Boost.Python.function object at 0x55a2a5743520> returned a result with an error set