kaist-amsg / LocalRetro

Retrosynthesis prediction for organic molecules with LocalRetro
82 stars 24 forks source link

FileNotFoundError: [Errno 2] No such file or directory: 'models/LocalRetro_USPTO_MIT.pth' #7

Closed wiemta closed 2 years ago

wiemta commented 2 years ago

FileNotFoundError Traceback (most recent call last) in () 1 args = {'data_dir': data_dir, 'model_path': model_path, 'config_path': config_path, 'device': device} ----> 2 model, graph_function, atom_templates, bond_templates, template_infos = init_LocalRetro(args)

4 frames /content/gdrive/MyDrive/monstage/LocalRetro/Retrosynthesis.py in init_LocalRetro(args) 38 args['mode'] = 'test' 39 args = init_featurizer(args) ---> 40 model = load_model(args) 41 atom_templates, bond_templates, template_infos = load_templates(args) 42 smiles_to_graph = partial(smiles_to_bigraph, add_self_loop=True)

/content/gdrive/MyDrive/monstage/LocalRetro/scripts/utils.py in load_model(args) 116 117 else: --> 118 model.load_state_dict(torch.load(args['model_path'])['model_state_dict']) 119 return model 120

/usr/local/lib/python3.7/dist-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.

/usr/local/lib/python3.7/dist-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:

/usr/local/lib/python3.7/dist-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: 'models/LocalRetro_USPTO_MIT.pth' er

shuan4638 commented 2 years ago

Hi @wiemta This model LocalRetro_USPTO_MIT.pth will only exist after you train the model. Please follow the instructions in README.md to train the model. If you just want to demo a few retrosynthesis tasks, we are currently develop a user-friendly website for people who are not familiar with coding. We will announce it once the website is launched :)