cgoliver / rnaglib

Datasets and analysis tools for RNA 3D and 2.5D structures.
https://rnaglib.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
12 stars 2 forks source link

bug in second example #3

Closed cgoliver closed 1 year ago

cgoliver commented 1 year ago
❯ rnaglib_second
Starting to pretrain the network
Dataset was found and not overwritten
Traceback (most recent call last):
  File "/Users/carlosoliver/.pyenv/versions/3.10.4/bin/rnaglib_second", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/Users/carlosoliver/Projects/rnaglib/rnaglib/examples/rnaglib_second", line 34, in <module>
    learn.pretrain_unsupervised(model=embedder_model,
  File "/Users/carlosoliver/Projects/rnaglib/rnaglib/learning/learn.py", line 51, in pretrain_unsupervised
    for batch_idx, batch in enumerate(train_loader):
  File "/Users/carlosoliver/.pyenv/versions/3.10.4/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 628, in __next__
    data = self._next_data()
  File "/Users/carlosoliver/.pyenv/versions/3.10.4/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1333, in _next_data
    return self._process_data(data)
  File "/Users/carlosoliver/.pyenv/versions/3.10.4/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1359, in _process_data
    data.reraise()
  File "/Users/carlosoliver/.pyenv/versions/3.10.4/lib/python3.10/site-packages/torch/_utils.py", line 543, in reraise
    raise exception
ValueError: Caught ValueError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/Users/carlosoliver/.pyenv/versions/3.10.4/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop
    data = fetcher.fetch(index)
  File "/Users/carlosoliver/.pyenv/versions/3.10.4/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 58, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/Users/carlosoliver/.pyenv/versions/3.10.4/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 58, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/Users/carlosoliver/Projects/rnaglib/rnaglib/data_loading/rna_dataset.py", line 99, in __getitem__
    rna_dict[rep.name] = rep(rna_graph, features_dict)
  File "/Users/carlosoliver/Projects/rnaglib/rnaglib/representations/rings.py", line 27, in __call__
    raise ValueError(
ValueError: To use rings, one needs to use annotated data. The key graphlet_annots is missing from the graph.
cgoliver commented 1 year ago

This was because i was using a non-annotated dataset. Will push an annotated data release.