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

关于调整样本滑块间隔的问题 #39

Closed
dryland107 opened this issue Apr 29, 2022 · 1 comment
Closed

关于调整样本滑块间隔的问题 #39

dryland107 opened this issue Apr 29, 2022 · 1 comment

Comments

@dryland107
Copy link

作者,你好,目前在学习用autoformer做时序数据预测,谢谢你的论文和源码,受益良多。
有个问题想请教下,烦请解答下。
数据集使用ETTm1.csv,目前data_loader的__getitem__函数中,s_begin = index,即样本数据是通过传入的index进行滑块。在该数据集上也就是15分钟一个间隔往后滑一个间隔。因为业务场景需要(以天为单位进行预测),我原本设想通过调整代码s_begin = index * 96,来严格限定每个样本数据从一天中的第一个时刻开始,一个batch包含32天的样本。但是运行代码时报以下错误:
File "/home/ubuntu/anaconda3/envs/series-forecasting/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 530, in __next__data = self._next_data()
File "/home/ubuntu/anaconda3/envs/series-forecasting/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1204, in _next_data
return self._process_data(data)
File "/home/ubuntu/anaconda3/envs/series-forecasting/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1250, in _process_data
data.reraise()
File "/home/ubuntu/anaconda3/envs/series-forecasting/lib/python3.8/site-packages/torch/_utils.py", line 457, in reraise
raise exception
RuntimeError: Caught RuntimeError in DataLoader worker process 8.
Original Traceback (most recent call last):
File "/home/ubuntu/anaconda3/envs/series-forecasting/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "/home/ubuntu/anaconda3/envs/series-forecasting/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 52, in fetch
return self.collate_fn(data)
File "/home/ubuntu/anaconda3/envs/series-forecasting/lib/python3.8/site-packages/torch/utils/data/_utils/collate.py", line 172, in default_collate
return [default_collate(samples) for samples in transposed] # Backwards compatibility.
File "/home/ubuntu/anaconda3/envs/series-forecasting/lib/python3.8/site-packages/torch/utils/data/_utils/collate.py", line 172, in
return [default_collate(samples) for samples in transposed] # Backwards compatibility.
File "/home/ubuntu/anaconda3/envs/series-forecasting/lib/python3.8/site-packages/torch/utils/data/_utils/collate.py", line 146, in default_collate
return default_collate([torch.as_tensor(b) for b in batch])
File "/home/ubuntu/anaconda3/envs/series-forecasting/lib/python3.8/site-packages/torch/utils/data/utils/collate.py", line 137, in default_collate
out = elem.new(storage).resize
(len(batch), *list(elem.size()))
RuntimeError: Trying to resize storage that is not resizable
尝试调整drop_last和num_workers,无效。

@wuhaixu2016
Copy link
Collaborator

Same question in #40

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

2 participants