Skip to content

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (370, 3) + inhomogeneous part. #3

Description

@imb-ai-junghwan

Hi. PopPhy-CNN is really impressive, thanks for your remarkable job.
I tried to run this tool, but i got an error in 'prepare_data' func in prepare_data.py


ValueError Traceback (most recent call last)
Cell In[10], line 1
----> 1 np.array(np.take(results,1,1).tolist())

File <array_function internals>:200, in take(*args, **kwargs)

File ~/anaconda3/envs/torch/lib/python3.10/site-packages/numpy/core/fromnumeric.py:190, in take(a, indices, axis, out, mode)
93 @array_function_dispatch(_take_dispatcher)
94 def take(a, indices, axis=None, out=None, mode='raise'):
95 """
96 Take elements from an array along an axis.
97
(...)
188 [5, 7]])
189 """
--> 190 return _wrapfunc(a, 'take', indices, axis=axis, out=out, mode=mode)

File ~/anaconda3/envs/torch/lib/python3.10/site-packages/numpy/core/fromnumeric.py:54, in _wrapfunc(obj, method, *args, **kwds)
52 bound = getattr(obj, method, None)
53 if bound is None:
---> 54 return _wrapit(obj, method, *args, **kwds)
56 try:
57 return bound(*args, **kwds)

File ~/anaconda3/envs/torch/lib/python3.10/site-packages/numpy/core/fromnumeric.py:43, in _wrapit(obj, method, *args, **kwds)
41 except AttributeError:
42 wrap = None
---> 43 result = getattr(asarray(obj), method)(*args, **kwds)
44 if wrap:
45 if not isinstance(result, mu.ndarray):

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (370, 3) + inhomogeneous part.

How to fix it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions