SYLan2019 / DSTAGNN

DSTAGNN: Dynamic Spatial-Temporal Aware Graph Neural Network for Traffic Flow Forecasting, which is accepted at ICML2022.
132 stars 22 forks source link

How do you deal with the invalid value when generate data? #1

Open zbliu98 opened 2 years ago

zbliu98 commented 2 years ago

image

WYH1597650862 commented 2 years ago

image

I also have the same question ,have you solve it?

Schwaldlander commented 2 years ago

I also have this similar problem running python STAG_gen.py

Schwaldlander commented 2 years ago

I just overcame this problem:

A_eq = np.array(A_eq).astype(np.float)#added b_eq = np.concatenate([p, q]) D = np.array(D).astype(np.float)#added since b_eq is float type, while A_eq and D are int type, there exists a discrepancy.

NoahWangc commented 2 years ago

I just overcame this problem:

A_eq = np.array(A_eq).astype(np.float)#added b_eq = np.concatenate([p, q]) D = np.array(D).astype(np.float)#added since b_eq is float type, while A_eq and D are int type, there exists a discrepancy.

This error still appears after the modification according to your method. Have you made any other modifications?looking forward to your reply.

Schwaldlander commented 2 years ago

Try using np.nan_to_num

hanshirong commented 1 year ago

我刚刚克服了这个问题: A_eq = np.array(A_eq).astype(np.float)#added b_eq = np.concatenate([p, q]) D = np.array(D).astype(np.float)#added由于 b_eq 是 float 类型,而 A_eq 和 D 是 int 类型,因此存在差异。

按照你的方法修改后还是会出现这个错误。您是否进行了其他修改?期待您的回复。

尝试通过上述方式更改代码,也不成解决这个问题,不知道您现在是否解决了这个问题,期待您的回复。

WYH1597650862 commented 1 year ago

我刚刚克服了这个问题: A_eq = np.array(A_eq).astype(np.float)#added b_eq = np.concatenate([p, q]) D = np.array(D).astype(np.float)#added由于 b_eq 是 float 类型,而 A_eq 和 D 是 int 类型,因此存在差异。

按照你的方法修改后还是会出现这个错误。您是否进行了其他修改?期待您的回复。

尝试通过上述方式更改代码,也不成解决这个问题,不知道您现在是否解决了这个问题,期待您的回复。 [Schwaldlander] has replied. Try using np.nan_to_num

hanshirong commented 1 year ago

我刚刚克服了这个问题: A_eq = np.array(A_eq).astype(np.float)#added b_eq = np.concatenate([p, q]) D = np.array(D).astype(np.float)#added由于 b_eq 是 float 类型,而 A_eq 和 D 是 int 类型,因此存在差异。

按照你的方法修改后还是会出现这个错误。您是否进行了其他修改?期待您的回复。

尝试通过上述方式更改代码,也不成解决这个问题,不知道您现在是否解决了这个问题,期待您的回复。 [Schwaldlander] has replied. Try using np.nan_to_num

thanks, i have solved this question.

StevDL-gif commented 1 year ago

Where should I apply this method using np.nan_to_num

limengran98 commented 1 year ago

np.nan_to_num I added the following two lines at line 27 of the source code to solve this problem: np.nan_to_num(A_eq, copy=False, nan=0.0, posinf=None, neginf=None) np.nan_to_num(D, copy=False, nan=0.0, posinf=None, neginf=None)

wy123go commented 1 year ago

请问一下,该模型与AGCRN模型做了对比实验,但是AGCRN原论文并没有对03,07数据集的实验部分,想请教一下您在AGCRN的03,07数据集的参数配置,调参一直没有达到您论文对比实验的指标。

zhoujiajuly commented 1 year ago

我刚刚克服了这个问题: A_eq = np.array(A_eq).astype(np.float)#added b_eq = np.concatenate([p, q]) D = np.array(D).astype(np.float)#added由于 b_eq 是 float 类型,而 A_eq 和 D 是 int 类型,因此存在差异。

按照你的方法修改后还是会出现这个错误。您是否进行了其他修改?期待您的回复。

尝试通过上述方式更改代码,也不成解决这个问题,不知道您现在是否解决了这个问题,期待您的回复。

请问您是如何解决的 我也正在被这个问题困扰

sunqiqi123456 commented 3 months ago

np.nan_to_num I added the following two lines at line 27 of the source code to solve this problem: np.nan_to_num(A_eq, copy=False, nan=0.0, posinf=None, neginf=None) np.nan_to_num(D, copy=False, nan=0.0, posinf=None, neginf=None)

np.nan_to_num I added the following two lines at line 27 of the source code to solve this problem: np.nan_to_num(A_eq, copy=False, nan=0.0, posinf=None, neginf=None) np.nan_to_num(D, copy=False, nan=0.0, posinf=None, neginf=None)

I also have sloved the problem through this method,thanks a lot~