Comments (4)
HI @manapshymyr-OB ,
can you have a look at this issue and see if it helps you?
from pytorch-psetae.
I executed following your comments and getting this error:
Traceback (most recent call last):
File "/agrospace/lightweight-temporal-attention-pytorch/train.py", line 363, in <module>
main(config)
File "/agrospace/lightweight-temporal-attention-pytorch/train.py", line 256, in main
train_metrics = train_epoch(model, optimizer, criterion, train_loader, device=device, config=config)
File "/agrospace/lightweight-temporal-attention-pytorch/train.py", line 26, in train_epoch
for i, (x, y) in enumerate(data_loader):
File "/agrospace/lightweight-temporal-attention-pytorch/vevn/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 632, in __next__
data = self._next_data()
File "/agrospace/lightweight-temporal-attention-pytorch/vevn/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1350, in _next_data
return self._process_data(data)
File "/agrospace/lightweight-temporal-attention-pytorch/vevn/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1376, in _process_data
data.reraise()
File "/agrospace/lightweight-temporal-attention-pytorch/vevn/lib/python3.10/site-packages/torch/_utils.py", line 694, in reraise
raise exception
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/agrospace/lightweight-temporal-attention-pytorch/vevn/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "/agrospace/lightweight-temporal-attention-pytorch/vevn/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 55, in fetch
return self.collate_fn(data)
File "/agrospace/lightweight-temporal-attention-pytorch/vevn/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 280, in default_collate
return collate(batch, collate_fn_map=default_collate_fn_map)
File "/agrospace/lightweight-temporal-attention-pytorch/vevn/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 143, in collate
return [collate(samples, collate_fn_map=collate_fn_map) for samples in transposed] # Backwards compatibility.
File "/agrospace/lightweight-temporal-attention-pytorch/vevn/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 143, in <listcomp>
return [collate(samples, collate_fn_map=collate_fn_map) for samples in transposed] # Backwards compatibility.
File "/agrospace/lightweight-temporal-attention-pytorch/vevn/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 143, in collate
return [collate(samples, collate_fn_map=collate_fn_map) for samples in transposed] # Backwards compatibility.
File "/agrospace/lightweight-temporal-attention-pytorch/vevn/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 143, in <listcomp>
return [collate(samples, collate_fn_map=collate_fn_map) for samples in transposed] # Backwards compatibility.
File "/agrospace/lightweight-temporal-attention-pytorch/vevn/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 120, in collate
return collate_fn_map[elem_type](batch, collate_fn_map=collate_fn_map)
File "/agrospace/lightweight-temporal-attention-pytorch/vevn/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 177, in collate_tensor_fn
return torch.stack(batch, 0, out=out)
RuntimeError: stack expects each tensor to be equal size, but got [123, 8, 64] at entry 0 and [117, 8, 64] at entry 1
and when I print the batch shapes with the following code:
for b in batch:
print(b.shape)
return torch.stack(batch, 0, out=out)
I see this:
which is correct (the first number represents sequence)
Any ideas how to work correctly with the sequential data (so I do not have equal data in terms of the time)?
from pytorch-psetae.
yes if you have time series of varying length, you need to implement a "collate" function with a padding strategy to form batches of equal size.
You can have a look at how we did it for the PASTIS dataset here
from pytorch-psetae.
Related Issues (20)
- Question about THEIA tiles pre-processing HOT 4
- dataset HOT 1
- Is dates.json mandatory? HOT 7
- GeoTiff and GeoJson HOT 2
- How to normalize data if I have dataset not for everyday? HOT 14
- Inference issue HOT 2
- Timestamp HOT 4
- Dataset.py script + geomfeat.json
- Tensor reshape HOT 4
- Duplicating pixels, DataLoader, pooling functions HOT 2
- What is the crop type of the 19 classes? And the 44classes?
- How do I build my own dataset? HOT 2
- Importance of dates.json and dataset with several seasons
- Generation of normalisation_values.pkl HOT 1
- geomfeat in paper HOT 3
- Linear interpolation of cloudy pixels HOT 8
- Question regarding the normalization values HOT 1
- About dataset. HOT 2
- Question HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch-psetae.