zhengchuanpan / GMAN

GMAN: A Graph Multi-Attention Network for Traffic Prediction (GMAN, https://fanxlxmu.github.io/publication/aaai2020/) was accepted by AAAI-2020.
Apache License 2.0
418 stars 106 forks source link

求指点:如何解决AttributeError: 'numpy.bytes_' object has no attribute 'delta' #21

Open EmlynQuan opened 4 years ago

EmlynQuan commented 4 years ago

utils.py中 timeofday = (Time.hour 3600 + Time.minute 60 + Time.second) // Time.freq.delta.total_seconds() 这一句报错

Traceback (most recent call last): File "/Users/crowd/PycharmProjects/GMAN/METR/train.py", line 55, in mean, std) = utils.loadData(args) File "/Users/crowd/PycharmProjects/GMAN/METR/utils.py", line 73, in loadData timeofday = (Time.hour 3600 + Time.minute 60 + Time.second) // Time.freq.delta.totalseconds() AttributeError: 'numpy.bytes' object has no attribute 'delta'

我没有修改过作者源码 请问这个问题大家是怎么解决的

TBS1234 commented 4 years ago

请问您解决了吗,我也是同样的问题

stanli124 commented 3 years ago

Time.freq.delta.total_seconds()这个换成 数字 300

BeverlyZ commented 2 years ago

Time.freq.delta.total_seconds()这个换成 数字 300

请问为什么是300呀?

0shelter0 commented 2 years ago

Time.freq.delta.total_seconds()这个换成 数字 300

请问为什么是300呀? that is because the time slot is 5 mins, i.e. 300 seconds. At corresponding code dividing 300 in order to get the time of day one-hot comes naturally.

muratbayrktr commented 2 years ago

In the code change Time.freq.delta.total_seconds() with args.time_slot*60.

In the arguments the time_slot is defined in minutes. That's why we are multiplying with 60. I think a more general solution would be to infer the time frequency directly from the h5 df but currently it doesn't seem possible. I couldn't think of more general solution.