mims-harvard / Raindrop

Graph Neural Networks for Irregular Time Series
MIT License
167 stars 35 forks source link

inhomogeneous shape error #10

Open JauJieYou opened 1 year ago

JauJieYou commented 1 year ago

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 commented 9 months ago

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

jbccc commented 3 months ago

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