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

New Dataset RuntimeError: dtypes match error. #3

Open
RichardShea opened this issue Sep 13, 2024 · 1 comment
Open

New Dataset RuntimeError: dtypes match error. #3

RichardShea opened this issue Sep 13, 2024 · 1 comment

Comments

@RichardShea
Copy link

Hi,

When trying to run a new dataset, I match the datatype exactly as the climate datatype. The new dataset are timestamps generated from a Hawkes process. Below is the error.

Thank you,

-Richard

_Traceback (most recent call last):
File "/content/train_ts.py", line 251, in
main()
File "/content/train_ts.py", line 168, in main
train_batch = next(train_gen)
File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py", line 630, in next
data = self._next_data()
File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py", line 1344, in _next_data
return self._process_data(data)
File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py", line 1370, in _process_data
data.reraise()
File "/usr/local/lib/python3.10/dist-packages/torch/_utils.py", line 706, in reraise
raise exception
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/_utils/worker.py", line 309, in _worker_loop
data = fetcher.fetch(index) # type: ignore[possibly-undefined]
File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/utils/fetch.py", line 55, in fetch
return self.collate_fn(data)
File "/content/ncdssm/datasets/climate.py", line 140, in collate_fn
comb_past_target[i, past_indices] = tgt
RuntimeError: Index put requires the source and destination dtypes match, got Double for the destination and Float for the source.

@abdulfatir
Copy link
Collaborator

Hi @RichardShea! I am not sure if using the same setup as the climate dataset is directly applicable on a new dataset. Maybe try adding print statements to debug which dtype is incorrect?

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