XuhanLiu / DrugEx

Deep learning toolkit for Drug Design with Pareto-based Multi-Objective optimization in Polypharmacology
MIT License
189 stars 66 forks source link

Keyerror has been occurred when I run pretrainer.py #8

Open Dharmogata opened 4 years ago

Dharmogata commented 4 years ago

Hello, Xuhan I got a key error when I run pretrainer.py scrip.

Could you please let me know why?

Thank you in advance.

keyerror

keyerror2

martin-sicho commented 4 years ago

I think this is the same problem as discussed in PR #3.

Dharmogata commented 4 years ago

@martin-sicho Thank you so much for your help. and I have got many keyErrors with '\' and 65, 66, 3 ... and '\' again. Could please give any advise? keyerror keyerror2

martin-sicho commented 4 years ago

No problem @gwanseum. It is some time since I worked with the internals of DrugEx so @XuhanLiu should be able to assist you better, but maybe we can still figure this out.

The '/' and '\' tokens have to do with stereochemistry, the configuration around the double bond to be precise. DrugEx was not designed with stereochemistry in mind as far as I know. You can try to include it in your 'voc.txt' and see what happens or you could strip srereochemistry from the input altogether. It is quite strange there would be two slashes next to each other, though. So the '\\' anomaly is probably a result of something trying to escape the backslash in your input),

The errors with numbers 65 and so on indicate that there is some kind of mismatch in the number of characters in the vocabulary. It is hard to interpret this since I don't know what your input looks like, though.

So I would suggest you check your inputs for strange characters and make sure that the vocabulary is created correctly.

By the way, I also have a slightly more user-friendly version of DrugEx here: https://github.com/martin-sicho/DrugEx/tree/feature/api. It can generate the voc.txt file from the input automatically so that you have all the tokens. It is not really documented yet (except for this notebook) and I would still suggest to check your input before using it, though.

Dharmogata commented 4 years ago

@martin-sicho I really appreciate your kind advice and finally found out what went wrong!

and I will definately go over a suggested user-friendly version of DrugEx!