-
Notifications
You must be signed in to change notification settings - Fork 209
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
Accessing properties in .db
files, tutorials 1, 2.
#633
Comments
Dear Anton, you can iterate through any subset of your data using the For the test set this could look like:
The fact that you defined Best, Jonas |
Dear Jonas, I am figuring out how to use dataloaders in (pyg) (mambaforge) popova@mi001pc014:~/Projects/citre-benchmarking/scripts$ python tmp.py
- bioactivity
0%| | 0/760 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/home/popova/Projects/citre-benchmarking/scripts/tmp.py", line 42, in <module>
for sample_idx, sample in enumerate(tqdm(dataloader)):
File "/home/popova/.pyenv/versions/mambaforge/envs/pyg/lib/python3.12/site-packages/tqdm/notebook.py", line 250, in __iter__
for obj in it:
File "/home/popova/.pyenv/versions/mambaforge/envs/pyg/lib/python3.12/site-packages/tqdm/std.py", line 1181, in __iter__
for obj in iterable:
File "/home/popova/.pyenv/versions/mambaforge/envs/pyg/lib/python3.12/site-packages/torch/utils/data/dataloader.py", line 631, in __next__
data = self._next_data()
^^^^^^^^^^^^^^^^^
File "/home/popova/.pyenv/versions/mambaforge/envs/pyg/lib/python3.12/site-packages/torch/utils/data/dataloader.py", line 1346, in _next_data
return self._process_data(data)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/popova/.pyenv/versions/mambaforge/envs/pyg/lib/python3.12/site-packages/torch/utils/data/dataloader.py", line 1372, in _process_data
data.reraise()
File "/home/popova/.pyenv/versions/mambaforge/envs/pyg/lib/python3.12/site-packages/torch/_utils.py", line 705, in reraise
raise exception
AttributeError: Caught AttributeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/popova/.pyenv/versions/mambaforge/envs/pyg/lib/python3.12/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
data = fetcher.fetch(index) # type: ignore[possibly-undefined]
^^^^^^^^^^^^^^^^^^^^
File "/home/popova/.pyenv/versions/mambaforge/envs/pyg/lib/python3.12/site-packages/torch/utils/data/_utils/fetch.py", line 51, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
~~~~~~~~~~~~^^^^^
File "/home/popova/.pyenv/versions/mambaforge/envs/pyg/lib/python3.12/site-packages/schnetpack/data/atoms.py", line 269, in __getitem__
props = self._get_properties(
^^^^^^^^^^^^^^^^^^^^^
File "/home/popova/.pyenv/versions/mambaforge/envs/pyg/lib/python3.12/site-packages/schnetpack/data/atoms.py", line 347, in _get_properties
torch.tensor(row.data[pname].copy()) * self.conversions[pname]
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'int' object has no attribute 'copy' Changed the property unit from Best regards, |
Hi Anton, this probably means that your target ( Best, Jonas |
Dear maintainers of SchNetPack,
I am following the tutorials from your repo and adapting it to my data. From tutorial 1 we have a
custom_data
object of the classschnetpack.data.datamodule.AtomsDataModule
that was generated for a set of SMILES and corresponding bioactivities labels like:So,
new_dataset
supposedly has a"bioactivity"
property. After saving it to the.db
file and loading with the command:I am trying to get an access to the
"bioactivity"
property. How should I do that? I want to use this label asU0
is used in the tutorial 2 in the "Setting up the model" section.I understand that the question probably should be addressed to the authors of
ase
package, but I appreciate it if you could provide any hint on how I can adapt your package (and tutorials in particular) to my data.Best regards,
Anton.
The text was updated successfully, but these errors were encountered: