GMAN icon indicating copy to clipboard operation
GMAN copied to clipboard

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

Open EmlynQuan opened this issue 4 years ago • 5 comments

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.total_seconds() AttributeError: 'numpy.bytes_' object has no attribute 'delta'

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

EmlynQuan avatar Sep 30 '20 08:09 EmlynQuan

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

TBS1234 avatar Oct 14 '20 00:10 TBS1234

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

stanli124 avatar Oct 05 '21 13:10 stanli124

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

请问为什么是300呀?

BeverlyZ avatar Mar 07 '22 02:03 BeverlyZ

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.

0shelter0 avatar Mar 08 '22 13:03 0shelter0

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.

muratbayrktr avatar Jul 26 '22 11:07 muratbayrktr