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

IndexError: index 524 is out of bounds for axis 0 with size 1 #1

Open
dengwanxia1991 opened this issue May 16, 2023 · 0 comments
Open

Comments

@dengwanxia1991
Copy link

Thank you for sharing the code. when I run the code using the fullyear_trainset_240_10_useful.nc dataset, I am faced with the problem "IndexError: index 524 is out of bounds for axis 0 with size 1". The detailed error information is as follows:
train size:11520, test size:2880
{'Total': 840028, 'Trainable': 840028}
start training...
Traceback (most recent call last):
File "E:\1-Meteorological and oceanic work\8 code\yaoyichen-radiationNet-0c53dfd\main_fullyear.py", line 357, in
for batch_idx, (feature, targets, auxis) in enumerate(train_loader):
File "D:\Anaconda2\envs\dwx3.8\lib\site-packages\torch\utils\data\dataloader.py", line 633, in next
data = self._next_data()
File "D:\Anaconda2\envs\dwx3.8\lib\site-packages\torch\utils\data\dataloader.py", line 1345, in _next_data
return self._process_data(data)
File "D:\Anaconda2\envs\dwx3.8\lib\site-packages\torch\utils\data\dataloader.py", line 1371, in _process_data
data.reraise()
File "D:\Anaconda2\envs\dwx3.8\lib\site-packages\torch_utils.py", line 644, in reraise
raise exception
IndexError: Caught IndexError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "D:\Anaconda2\envs\dwx3.8\lib\site-packages\torch\utils\data_utils\worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "D:\Anaconda2\envs\dwx3.8\lib\site-packages\torch\utils\data_utils\fetch.py", line 51, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "D:\Anaconda2\envs\dwx3.8\lib\site-packages\torch\utils\data_utils\fetch.py", line 51, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "E:\1-Meteorological and oceanic work\8 code\yaoyichen-radiationNet-0c53dfd\utils\data_helper.py", line 319, in getitem
temp = (df.variables[variable_name][time_index, global_index_list] -
File "D:\Anaconda2\envs\dwx3.8\lib\site-packages\xarray\core\variable.py", line 869, in getitem
data = as_indexable(self._data)[indexer]
File "D:\Anaconda2\envs\dwx3.8\lib\site-packages\xarray\core\indexing.py", line 662, in getitem
return type(self)(_wrap_numpy_scalars(self.array[key]))
File "D:\Anaconda2\envs\dwx3.8\lib\site-packages\xarray\core\indexing.py", line 631, in getitem
return type(self)(_wrap_numpy_scalars(self.array[key]))
File "D:\Anaconda2\envs\dwx3.8\lib\site-packages\xarray\core\indexing.py", line 538, in getitem
return type(self)(self.array, self._updated_key(indexer))
File "D:\Anaconda2\envs\dwx3.8\lib\site-packages\xarray\core\indexing.py", line 510, in _updated_key
full_key.append(_index_indexer_1d(k, next(iter_new_key), size))
File "D:\Anaconda2\envs\dwx3.8\lib\site-packages\xarray\core\indexing.py", line 283, in _index_indexer_1d
indexer = _expand_slice(old_indexer, size)[applied_indexer]
IndexError: index 525 is out of bounds for axis 0 with size 1

0%| | 0/58 [00:11<?, ?it/s]

Process finished with exit code 1

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

1 participant