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
KeyError: 'node_feature' from running deepdds_example.py #100
Comments
Hi, I just re-ran the example code with chemicalx 0.1.0 and had no such issue. Could you provide a bit more details? How are you running the example? |
I copied and pasted the python script and ran the script like python deepdds_example.py
0%| | 0/10 [00:00<?, ?it/s]
Traceback (most recent call last):
File "deepdds_example.py", line 27, in <module>
main()
File "deepdds_example.py", line 14, in main
results = pipeline(
File "/storage/htc/nih-tcga/sc724/conda/synergy/lib/python3.8/site-packages/chemicalx/pipeline.py", line 155, in pipeline
prediction = model(*model.unpack(batch))
File "/storage/htc/nih-tcga/sc724/conda/synergy/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/storage/htc/nih-tcga/sc724/conda/synergy/lib/python3.8/site-packages/chemicalx/models/deepdds.py", line 176, in forward
features_left = self._forward_molecules(molecules_left)
File "/storage/htc/nih-tcga/sc724/conda/synergy/lib/python3.8/site-packages/chemicalx/models/deepdds.py", line 158, in _forward_molecules
features = self.drug_conv(molecules, molecules.data_dict["node_feature"])["node_feature"]
KeyError: 'node_feature' |
Thanks so much for the help! I added the following code block at the top of example script for DeepDDS: But still the same issue : running with device: Tesla V100S-PCIE-32GB
0%| | 0/10 [00:00<?, ?it/s]
Traceback (most recent call last):
File "deepdds_example.py", line 30, in <module>
main()
File "deepdds_example.py", line 17, in main
results = pipeline(
File "/storage/htc/nih-tcga/sc724/conda/synergy/lib/python3.8/site-packages/chemicalx/pipeline.py", line 155, in pipeline
prediction = model(*model.unpack(batch))
File "/storage/htc/nih-tcga/sc724/conda/synergy/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/storage/htc/nih-tcga/sc724/conda/synergy/lib/python3.8/site-packages/chemicalx/models/deepdds.py", line 176, in forward
features_left = self._forward_molecules(molecules_left)
File "/storage/htc/nih-tcga/sc724/conda/synergy/lib/python3.8/site-packages/chemicalx/models/deepdds.py", line 158, in _forward_molecules
features = self.drug_conv(molecules, molecules.data_dict["node_feature"])["node_feature"]
KeyError: 'node_feature' But I can run the deepsynerg without this issue roc_auc 0.834909 |
It's not surprising that deepsynergy worked for you given that it has a way simpler architecture and doesn't use the same layer as deepdds. Could add the details of your environment? What versions of packages do you have in your env? |
Operating system : CENTOS_MANTISBT_PROJECT="CentOS-7" CentOS Linux release 7.9.2009 (Core)
Name Version Build Channel |
I think I found the root of the problem. It seems that with torchdrug update from 0.1.2 to 0.1.3, there was a change in the key name mentioned here:
This would mean that for this model to work with torchdrug 0.1.3 we'd have to rename "node_feature" key to "atom_feature" or fix torchdrug to 0.1.2. @cthoyt @benedekrozemberczki opinions? |
If AstraZeneca wants to pay for some consulting work done for this, I think the best strategy would be to divest from |
Please see the following log.
The text was updated successfully, but these errors were encountered: