Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inhomogeneous shape error #10

Open
JauJieYou opened this issue Sep 15, 2023 · 2 comments
Open

inhomogeneous shape error #10

JauJieYou opened this issue Sep 15, 2023 · 2 comments

Comments

@JauJieYou
Copy link

Dear Sir:
Thanks for your excellent job, but I got the error message while trying python Raindrop.py

"Dataset used: P12
args.dataset, args.splittype, args.reverse, args.withmissingratio, args.feature_removal_level P12 random False False no_removal
missing ratio list [0]
Split id: 1
9590 1199 1199 9590 1199 1199
Traceback (most recent call last):
File "/home/cmuh/Raindrop/code/Raindrop.py", line 192, in
mf, stdf = getStats(Ptrain_tensor)
File "/home/cmuh/Raindrop/code/utils_rd.py", line 160, in getStats
stdf[f] = np.max([stdf[f], eps])
File "/home/cmuh/anaconda3/envs/py39/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 2810, in max
return _wrapreduction(a, np.maximum, 'max', axis, None, out,
File "/home/cmuh/anaconda3/envs/py39/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 88, in _wrapreduction
return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part."

I am sorry that I had search in google, but the same situations needed modified argument.
Is there any possibility to solving it?
Thanks a lot

@islaxu
Copy link

islaxu commented Dec 22, 2023

i met the same problem, did you solve it? if you did, thank you for sharing!

@jbccc
Copy link

jbccc commented Jul 4, 2024

I solved it by replacing
stdf[f] = np.max([stdf[f], eps])stdf[f] = max(stdf[f], eps)
in the file code/utils_rd.py line 160.
I don't know if it is the best way, but now it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants