Skip to content
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

ModuleNotFoundError: No module named 'onmt.reinforce.score_util' #4

Open
Jacyll opened this issue Nov 12, 2022 · 3 comments
Open

ModuleNotFoundError: No module named 'onmt.reinforce.score_util' #4

Jacyll opened this issue Nov 12, 2022 · 3 comments

Comments

@Jacyll
Copy link

Jacyll commented Nov 12, 2022

I get the following error when I run the train_case.sh script after fine-tune-training.sh:

training RL model
train_agent_ms.py
Traceback (most recent call last):
File "train_agent_ms.py", line 8, in
from onmt.reinforce.trainer_ms import build_rl_ms_trainer
File "/home/test_file/PROTAC-RL-main/onmt/reinforce/trainer_ms.py", line 29, in
from onmt.reinforce.scoring_functions import get_scoring_function
File "/home/test_file/PROTAC-RL-main/onmt/reinforce/scoring_functions.py", line 22, in
from onmt.reinforce.score_util import calc_SC_RDKit_score
ModuleNotFoundError: No module named 'onmt.reinforce.score_util'

It appears that the uploaded files are incomplete. There is a missing function onmt.reinforce.score_util* in this file.

@yjianzhu
Copy link

yjianzhu commented Dec 1, 2022

I've met the same error and just delete line 22 in "/home/test_file/PROTAC-RL-main/onmt/reinforce/scoring_functions.py".

@xiejuande
Copy link

I've met the same error and just delete line 22 in "/home/test_file/PROTAC-RL-main/onmt/reinforce/scoring_functions.py".

Hello, after that, do you meet the error about "UnboundLocalError: local variable 'smiles_sequences_standard' referenced before assignment" when running "bash train_case.sh" like follows:
training RL model
train_agent_ms.py
sample_rate:16000
window_size:0.02
window_stride:0.01
window:hamming
image_channel_size:3
scoring_function:PK
score_function_num_processes:2
[2024-05-09 17:54:25,061 INFO] Start training...
[2024-05-09 17:54:25,064 INFO] cur device: cuda
[2024-05-09 17:54:25,068 INFO] C(=O)C[C@@h]1N=C(c2ccc(Cl)cc2)c2c(sc(C)c2C)-n2c(C)nnc21.*c1cccc2c1C(=O)N(C1CCC(=O)NC1=O)C2=O
[2024-05-09 17:54:25,068 INFO] Cc1sc2c(c1C)C(c1ccc(Cl)cc1)=NC@@Hc1nnc(C)n1-2
[2024-05-09 17:54:28,768 INFO] Step ------ 0;
[2024-05-09 17:54:28,769 INFO] loss ::: 1484.64404296875, score: 0.5641969442367554, lr: (1e-05, 1e-05)
[2024-05-09 17:54:28,769 INFO] agent_likelihood:-7.786715030670166, augmented_likelihood: 26.06537628173828, prior_likelihood:-7.786439418792725
[2024-05-09 17:54:28,804 INFO] Step 0;Fraction valid SMILES: 100.0
[2024-05-09 17:54:28,804 INFO] samples:
Traceback (most recent call last):
File "train_agent_ms.py", line 40, in
main(opt, logger)
File "train_agent_ms.py", line 27, in main
logger=logger)
File "/lustre/home/jxie/soft/PROTAC-RL/onmt/reinforce/trainer_ms.py", line 417, in train
info(smiles_sequences_standard[i])
UnboundLocalError: local variable 'smiles_sequences_standard' referenced before assignment

@ZiggeyQi
Copy link

I've met the same error and just delete line 22 in "/home/test_file/PROTAC-RL-main/onmt/reinforce/scoring_functions.py".

Hello, after that, do you meet the error about "UnboundLocalError: local variable 'smiles_sequences_standard' referenced before assignment" when running "bash train_case.sh" like follows: training RL model train_agent_ms.py sample_rate:16000 window_size:0.02 window_stride:0.01 window:hamming image_channel_size:3 scoring_function:PK score_function_num_processes:2 [2024-05-09 17:54:25,061 INFO] Start training... [2024-05-09 17:54:25,064 INFO] cur device: cuda [2024-05-09 17:54:25,068 INFO] C(=O)C[C@@h]1N=C(c2ccc(Cl)cc2)c2c(sc(C)c2C)-n2c(C)nnc21.*c1cccc2c1C(=O)N(C1CCC(=O)NC1=O)C2=O [2024-05-09 17:54:25,068 INFO] Cc1sc2c(c1C)C(c1ccc(Cl)cc1)=NC@@Hc1nnc(C)n1-2 [2024-05-09 17:54:28,768 INFO] Step ------ 0; [2024-05-09 17:54:28,769 INFO] loss ::: 1484.64404296875, score: 0.5641969442367554, lr: (1e-05, 1e-05) [2024-05-09 17:54:28,769 INFO] agent_likelihood:-7.786715030670166, augmented_likelihood: 26.06537628173828, prior_likelihood:-7.786439418792725 [2024-05-09 17:54:28,804 INFO] Step 0;Fraction valid SMILES: 100.0 [2024-05-09 17:54:28,804 INFO] samples: Traceback (most recent call last): File "train_agent_ms.py", line 40, in main(opt, logger) File "train_agent_ms.py", line 27, in main logger=logger) File "/lustre/home/jxie/soft/PROTAC-RL/onmt/reinforce/trainer_ms.py", line 417, in train info(smiles_sequences_standard[i]) UnboundLocalError: local variable 'smiles_sequences_standard' referenced before assignment

Hi, did you solve this problem yet, would you like to share something with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants