Hi @xuanliugit , I'm trying to run your code (at Matt Berry's request) and it appears I'm missing the file rxn_cluster_token_prompt/models/class_token_retro_std_pistachio_201002_12tokens_with-reagents_step_260000.pt
Can you please provide me with that pytorch file? That's blocking me from running ACERetro Thanks!
To reproduce
Follow ALL installation instructions in the README.
Make adjustments to hdbscan, joblib, and six to fix install dependency problems...
Run the below code.
Code:
# ./pathway_search_standalone/
import sys
import joblib
import six
sys.modules['sklearn.externals.joblib'] = joblib
sys.modules['sklearn.externals.six'] = six
from pathway_search_standalone.scripts.search_utils import hybridSearch
hybridSearch = hybridSearch()
smiles = 'CC[C@@H](CO)NCCN[C@@H](CC)CO' # Target molecule's SMILES
# Conduct a 3 min asynchronous chemoenzymatic synthesis planning
explored_rxns, explored_nodes, start_node = hybridSearch.get_chemoenzy_path_async(smiles, max_depth=10, chem_topk=10, max_num_templates=250, max_branching=15, time_lim=180)
Outputs:
INFO@pricer : [1718667177.984s] Loaded prices from flat file
INFO@retro_transformer : [1718667177.985s] Loading template prioritizer for RetroTransformer
INFO@retro_transformer : [1718667178.237s] Loading precursor prioritizer for RetroTransformer
INFO@pricer : [1718667179.297s] Cannot connect to mongodb to load prices
INFO@pricer : [1718667179.632s] Loaded prices from flat file
INFO@retro_transformer : [1718667179.673s] Loading fast filter for RetroTransformer
INFO@fast_filter : [1718667179.674s] Starting to load fast filter
INFO@fast_filter : [1718667180.273s] Done loading fast filter
INFO@retro_transformer : [1718667180.274s] Using default clustering for RetroTransformer
INFO@retro_transformer : [1718667180.274s] Loading retro-synthetic transformer
INFO@retro_transformer : [1718667180.274s] reading from file
INFO@template_transformer: [1718667180.274s] Loading templates from [/home/kastan/ncsa/mmli/ACERetro/pathway_search_standalone/askcos-core/askcos/data/bkms-data/templates/bkms-and-reaxys-templates.json.gz](https://vscode-remote+ssh-002dremote-002bdankserver.vscode-resource.vscode-cdn.net/home/kastan/ncsa/mmli/ACERetro/pathway_search_standalone/askcos-core/askcos/data/bkms-data/templates/bkms-and-reaxys-templates.json.gz)
INFO@template_transformer: [1718667182.795s] Loaded templates. Using 7984 templates
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
<ipython-input-4-2dde280b5894> in <module>
8
9 from pathway_search_standalone.scripts.search_utils import hybridSearch
---> 10 hybridSearch = hybridSearch()
11 smiles = 'CC[C@@H](CO)NCCN[C@@H](CC)CO' # Target molecule's SMILES
12 # Conduct a 3 min asynchronous chemoenzymatic synthesis planning
~/ncsa/mmli/ACERetro/pathway_search_standalone/scripts/search_utils.py in __init__(self, pricer, sfef, deepef, geo_iso)
83 self.askcos_enzy.load('bkms')
84
---> 85 self.rxn4chem_retro_model = RXNClusterTokenPrompt(n_best=1)
86
87 self.sfscore_model = SFScore()
~/ncsa/mmli/ACERetro/pathway_search_standalone/rxn_cluster_token_prompt/rxn_cluster_token_prompt/model.py in __init__(self, retro_model_path, forward_model_path, classification_model_path, n_tokens, beam_size, max_length, batch_size, n_best)
101 max_length=self.max_length,
102 batch_size=self.batch_size,
--> 103 gpu=-1,
104 )
105
~/ncsa/mmli/ACERetro/pathway_search_standalone/rxn_cluster_token_prompt/rxn_cluster_token_prompt/onmt_utils/translator.py in from_model_path(cls, model_path, **kwargs)
89 model_path = [model_path]
90 opt = get_onmt_opt(translation_model=list(model_path), **kwargs)
---> 91 return cls(opt=opt)
92
93 @classmethod
~/ncsa/mmli/ACERetro/pathway_search_standalone/rxn_cluster_token_prompt/rxn_cluster_token_prompt/onmt_utils/translator.py in __init__(self, opt)
21 opt: model options.
22 """
---> 23 self.onmt_translator = RawTranslator(opt=opt)
24
25 def translate_single(self, sentence: str) -> str:
~/ncsa/mmli/ACERetro/pathway_search_standalone/rxn_cluster_token_prompt/rxn_cluster_token_prompt/onmt_utils/internal_translation_utils.py in __init__(self, opt)
36 out_file = open(os.devnull, "w")
37 self.internal_translator = build_translator(
---> 38 self.opt, report_score=False, out_file=out_file
39 )
40
~/utils/miniconda3/envs/aceretro/lib/python3.6/site-packages/onmt/translate/translator.py in build_translator(opt, report_score, logger, out_file)
31 else onmt.model_builder.load_test_model
32 )
---> 33 fields, model, model_opt = load_test_model(opt)
34
35 scorer = onmt.translate.GNMTGlobalScorer.from_opt(opt)
~/utils/miniconda3/envs/aceretro/lib/python3.6/site-packages/onmt/model_builder.py in load_test_model(opt, model_path)
83 model_path = opt.models[0]
84 checkpoint = torch.load(model_path,
---> 85 map_location=lambda storage, loc: storage)
86
87 model_opt = ArgumentParser.ckpt_model_opts(checkpoint['opt'])
~/utils/miniconda3/envs/aceretro/lib/python3.6/site-packages/torch/serialization.py in load(f, map_location, pickle_module, **pickle_load_args)
592 pickle_load_args['encoding'] = 'utf-8'
593
--> 594 with _open_file_like(f, 'rb') as opened_file:
595 if _is_zipfile(opened_file):
596 # The zipfile reader is going to advance the current file position.
~/utils/miniconda3/envs/aceretro/lib/python3.6/site-packages/torch/serialization.py in _open_file_like(name_or_buffer, mode)
228 def _open_file_like(name_or_buffer, mode):
229 if _is_path(name_or_buffer):
--> 230 return _open_file(name_or_buffer, mode)
231 else:
232 if 'w' in mode:
~/utils/miniconda3/envs/aceretro/lib/python3.6/site-packages/torch/serialization.py in __init__(self, name, mode)
209 class _open_file(_opener):
210 def __init__(self, name, mode):
--> 211 super(_open_file, self).__init__(open(name, mode))
212
213 def __exit__(self, *args):
FileNotFoundError: [Errno 2] No such file or directory: '/home/kastan/ncsa/mmli/ACERetro/pathway_search_standalone/rxn_cluster_token_prompt/models/class_token_retro_std_pistachio_201002_12tokens_with-reagents_step_260000.pt'
Hi @xuanliugit , I'm trying to run your code (at Matt Berry's request) and it appears I'm missing the file
rxn_cluster_token_prompt/models/class_token_retro_std_pistachio_201002_12tokens_with-reagents_step_260000.pt
Can you please provide me with that pytorch file? That's blocking me from running ACERetro Thanks!
To reproduce
hdbscan
,joblib
, andsix
to fix install dependency problems...Code:
Outputs: