You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original Traceback (most recent call last):
File "/home/data/yh/miniconda/envs/nudt/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop
data = fetcher.fetch(index)
File "/home/data/yh/miniconda/envs/nudt/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 32, in fetch
data.append(next(self.dataset_iter))
File "/home/data/yh/nudt/graph_weather-main/train/run.py", line 428, in iter
day_of_year = data["timestamps"][0].dayofyear / 366.0
AttributeError: 'datetime.datetime' object has no attribute 'dayofyear'
I think the attribute used here should be 'day' instead.
The text was updated successfully, but these errors were encountered:
Replace the code "day_of_year = data["timestamps"][0].dayofyear / 366.0" in the iter() function of the XrDataset with the following lines can tackle this issue.
date = data["timestamps"][0]
day_of_year = ((date-datetime.datetime(date.year,1,1)).days+1) / 366.0
Original Traceback (most recent call last):
File "/home/data/yh/miniconda/envs/nudt/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop
data = fetcher.fetch(index)
File "/home/data/yh/miniconda/envs/nudt/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 32, in fetch
data.append(next(self.dataset_iter))
File "/home/data/yh/nudt/graph_weather-main/train/run.py", line 428, in iter
day_of_year = data["timestamps"][0].dayofyear / 366.0
AttributeError: 'datetime.datetime' object has no attribute 'dayofyear'
I think the attribute used here should be 'day' instead.
The text was updated successfully, but these errors were encountered: