Closed aa0929 closed 1 year ago
Hello, Please use a more informative title/description in the future. Also: please provide some details on what you are trying to do with the GUI: what expansion policy are you trying to use? How is your config file looks like?
Hello,thankyou for your reply!
policy: files: full_uspto:
policy: files: full_uspto:
Thanks for the details. The config looks ok with the expansion policy specification (although the stock path appears to be incorrect).
It appears that there is something else at the end of the error trace, because I have a hard time imagining what is causing a type error at line 113 of policies.py. Could you be so kind and show the full error trace?
Aha. This is the issue.
In the latest release we dropped support for Tensorflow by defaults.
If you now, re-run the "download_public_data" script you should get ONNX files that can be use with the latest version.
(Alternatively, you can do something like pip install aizynthfinder[tf]
to install the Tensorflow dependencies, but that is much more work).
I was very excited to try it and the previous error is gone, but a new one appears
The two files you should use for the config are uspto_model.onnx
and uspto_templates.csv.gz
.
The config file should be something like this
policy:
files:
uspto:
- uspto_model.onnx
- uspto_templates.csv.gz
ringbreaker:
- uspto_ringbreaker_model.onnx
- uspto_ringbreaker_templates.csv.gz
filter:
files:
uspto: uspto_filter_model.onnx
stock:
files:
zinc: zinc_stock.hdf5
Thank you for your guidance, the problem has been solved, after doing what you said, I also encountered a component loading problem, the following when the solution, will be helpful to those who will follow 【jupyter notebook中ipywidgets插件不显示】https://blog.csdn.net/qxqxqzzz/article/details/93810518 【PermissionError: [Errno 13] Permission denied】https://blog.csdn.net/weixin_62888476/article/details/127768242?ops_request_misc=&request_id=&biz_id=102&utm_term=PermissionError:%20%5BErrno%2013%5D%20Pe&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-0-127768242.142^v91^insert_down1,239^v3^insert_chatgpt&spm=1018.2226.3001.4187 【Loading widget...】https://github.com/jupyter-widgets/ipywidgets/issues/2623
thanks!!!
This is the hint given by jupyter
ValueError Traceback (most recent call last) Cell In[1], line 3 1 from aizynthfinder.interfaces import AiZynthApp 2 configfile=r"C:\Users\bo jin\config.yml" ----> 3 app = AiZynthApp(configfile) File ~.conda\envs\aizynth-env\lib\site-packages\aizynthfinder\interfaces\aizynthapp.py:60, in AiZynthApp.init(self, configfile, setup) 57 def init(self, configfile: str, setup: bool = True) -> None: 58 # pylint: disable=used-before-assignment 59 setup_logger(logging.INFO) ---> 60 self.finder = AiZynthFinder(configfile=configfile) 61 self._input: StrDict = dict() 62 self._output: StrDict = dict()
File ~.conda\envs\aizynth-env\lib\site-packages\aizynthfinder\aizynthfinder.py:67, in AiZynthFinder.init(self, configfile, configdict) 64 self._logger = logger() 66 if configfile: ---> 67 self.config = Configuration.from_file(configfile) 68 elif configdict: 69 self.config = Configuration.from_dict(configdict)
File ~.conda\envs\aizynth-env\lib\site-packages\aizynthfinder\context\config.py:129, in Configuration.from_file(cls, filename) 127 txt = txt.replace(item, os.environ[item[2:-1]]) 128 _config = yaml.load(txt, Loader=yaml.SafeLoader) --> 129 return Configuration.from_dict(_config)
File ~.conda\envs\aizynth-env\lib\site-packages\aizynthfinder\context\config.py:98, in Configuration.from_dict(cls, source) 95 src_copy = dict(source) # Make a copy so we can pop items 96 config_obj._update_from_config(src_copy) ---> 98 config_obj.expansion_policy.load_from_config(src_copy.get("policy", {})) 99 config_obj.filter_policy.load_from_config(src_copy.get("filter", {})) 100 config_obj.stock.load_from_config(**src_copy.get("stock", {}))
File ~.conda\envs\aizynth-env\lib\site-packages\aizynthfinder\context\policy\policies.py:113, in ExpansionPolicy.load_from_config(self, **config) 111 for key, policy_spec in files_spec.items(): 112 modelfile, templatefile = policy_spec --> 113 strategy = TemplateBasedExpansionStrategy( 114 key, self._config, source=modelfile, templatefile=templatefile 115 )