DeepPavlov
DeepPavlov copied to clipboard
odqa example gives RuntimeError in Win10
I run this code: from deeppavlov import configs from deeppavlov.core.common.file import read_json from deeppavlov import configs, train_model
model_config = read_json(configs.doc_retrieval.en_ranker_tfidf_wiki) model_config["dataset_reader"]["data_path"] = "SentenceCorpus/unlabeled_articles/plos_unlabeled" model_config["dataset_reader"]["dataset_format"] = "txt" model_config["dataset_reader"]["save_path"] = "odqa/enwiki.db" model_config["dataset_iterator"]["load_path"] = "odqa/enwiki.db" doc_retrieval = train_model(model_config)
I get this:
2019-08-07 15:21:53.184 INFO in 'deeppavlov.dataset_readers.odqa_reader'['odqa_reader'] at line 57: Reading files...
2019-08-07 15:21:53.185 INFO in 'deeppavlov.dataset_readers.odqa_reader'['odqa_reader'] at line 134: Building the database...
2019-08-07 15:21:54.48 INFO in 'deeppavlov.dataset_readers.odqa_reader'['odqa_reader'] at line 57: Reading files...
2019-08-07 15:21:54.50 INFO in 'deeppavlov.dataset_readers.odqa_reader'['odqa_reader'] at line 134: Building the database...
Traceback (most recent call last):
File "
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
2019-08-07 15:21:54.429 INFO in 'deeppavlov.dataset_readers.odqa_reader'['odqa_reader'] at line 57: Reading files... 2019-08-07 15:21:54.430 INFO in 'deeppavlov.dataset_readers.odqa_reader'['odqa_reader'] at line 134: Building the database...
and another issue: File "c:\projects\rasa\deeppavlov-master\deeppavlov\dataset_readers\odqa_reader.py", line 130, in _build_db Path(save_path).unlink() File "C:\Installed\Anaconda3\envs\RASA_Chatbot\lib\pathlib.py", line 1287, in unlink self._accessor.unlink(self) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Projects\RASA\FAQ_BERT_Chatbot\rnet_test\odqa\enwiki.db' 2019-08-07 15:34:53.759 INFO in 'deeppavlov.dataset_readers.odqa_reader'['odqa_reader'] at line 57: Reading files...
and another issue in odqa_reader.py line 142 I had to add IF NOT EXISTS: sql_table = "CREATE TABLE IF NOT EXISTS documents (id PRIMARY KEY, text);"
Hello, @alex-movila! Sorry for the late response. We tested this issue on DeepPavlov version 1.2.0 and didn’t encounter the described problem. If you are still having difficulties with this, please let us know.