-
Notifications
You must be signed in to change notification settings - Fork 60
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
'NGram' object has no attribute '_sample_order' #251
Comments
@rnaimehaom Thank you for point this issue out. Actually, we are planning to renew the tutorial as it is quite outdated. For now, please manually add the attribute using the following code: Let me know if you still run into problem after adding this line of code to your program. |
@stewu5 Thank you. Not sure if what I did in the correct way: ############################# Then I got the error: lib\site-packages\xenonpy\inverse\iqspr\modifier.py", line 127, in min_len AttributeError: 'NGram' object has no attribute '_min_len' |
@rnaimehaom sorry for the trouble... I thought I have updated the NGram object already... Just to give you an explanation why this is happening, the NGram object you downloaded (for some unknown reason) is created with an older version of xenonpy that does not provide default values for some of the internal variables. This has been fixed in the latest xenonpy version, so if you create/train a new NGram object yourself, you will not face these errors. |
@stewu5 Thank you so much. As you said, I may need re-generate the file in order to avoid these kinds of error. In fact after using your way, error still exists. So I will get new files instead of using the old files. |
Still have error after including those four lines? We are going to check all the old tutorials later. Hopefully we can help you through before the next update is available. |
Hi @stewu5 , Below is the error information for your reference. ######################################################### with open('c:/pk/ngram_pubchem_ikebata_reO15_O10.obj', 'rb') as f: with open('c:/pk/ngram_pubchem_ikebata_reO15_O11to20.obj', 'rb') as f: n_gram._sample_order = (1, 10) n_gram.merge_table(n_gram2) Traceback (most recent call last): envs\xenonpy\lib\site-packages\xenonpy\inverse\iqspr\modifier.py", line 116, in reorder_prob AttributeError: 'NGram' object has no attribute '_reorder_prob' |
@rnaimehaom I planned to update the tutorial and the ngram files by the end of this week. Please try again then. Sorry for the trouble and the wait. |
@stewu5 Thank you so much. I look forward to learning your updated tutorials. |
@rnaimehaom We have updated the tutorial and the n_gram files. Please go to the samples folder and get the latest iQSPR.ipynb file as the new version of the tutorial. Let me know if you still run into problems. |
@stewu5 Hi Stepen, it works very well for now. Thanks so much! Sorry about for late response but I just finished to run the iQSPR.ipynb. I have other questions:
|
@rnaimehaom Good to know that everything works well now.
|
@stewu5 Thanks very much. Hopefully you can develop/expand XenonPy to handle large [small molecules] in the future, which will be very helpful. |
@rnaimehaom |
@TsumiNa Thanks so much for your help. I will give a try that. |
Hello,
I am learning this tutorial:
https://github.com/yoshida-lab/XenonPy/blob/master/samples/iQSPR.ipynb
When I run the following code, I got the error, but I cannot figure out.
Both 'ngram_pubchem_ikebata_reO15_O10.obj' and 'ngram_pubchem_ikebata_reO15_O11to20.obj' were downloaded according to the tutorial.
Ok to run
with open('ngram_pubchem_ikebata_reO15_O10.obj', 'rb') as f:
n_gram = pk.load(f)
Ok to run
with open('ngram_pubchem_ikebata_reO15_O11to20.obj', 'rb') as f:
n_gram2 = pk.load(f)
Error here
n_gram.merge_table(n_gram2)
###################
The error output
\envs\xenonpy\lib\site-packages\xenonpy\inverse\iqspr\modifier.py", line 96, in sample_order
return self._sample_order
AttributeError: 'NGram' object has no attribute '_sample_order'
###################
Can you help to solve this?
Thanks,
Ming
The text was updated successfully, but these errors were encountered: