TorchSpatiotemporal / tsl

tsl: a PyTorch library for processing spatiotemporal data.
https://torch-spatiotemporal.readthedocs.io/
MIT License
267 stars 24 forks source link

BUG in static_graph_collate function #34

Open k-markov opened 7 months ago

k-markov commented 7 months ago

Hi, tried to make a StaticBatch from a list of Data objects and it crashed with:

    72 out = out.stores_as(elem)
    74 pattern = elem.pattern

---> 76 for key in elem.keys: 77 if key == 'transform': 78 out[key] = static_scaler_collate([data[key] for data in data_list])

TypeError: 'method' object is not iterable

Putting () after elem.keys fixes the problem.

marshka commented 6 months ago

Hi, this is due to an update to PyG's Data object in the last versions. They changed Data.keys from property to method. We'll find a solution for tsl's Data accordingly, thanks for the feedback!