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

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

Open
EmlynQuan opened this issue Sep 30, 2020 · 5 comments

Comments

@EmlynQuan
Copy link

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'

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

@TBS1234
Copy link

TBS1234 commented Oct 14, 2020

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

@stanli124
Copy link

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

@BeverlyZ
Copy link

BeverlyZ commented Mar 7, 2022

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

请问为什么是300呀?

@0shelter0
Copy link

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
Copy link

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.

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

6 participants