facebookresearch / ParlAI

A framework for training and evaluating AI models on a variety of openly available dialogue datasets.
https://parl.ai
MIT License
10.49k stars 2.1k forks source link

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: #3185

Closed SEMTEX99 closed 4 years ago

SEMTEX99 commented 4 years ago

Using pycharm with venv py 3.6 sticking with the quickstart tutorial that is in the docs, but when i try to run: parlai display_data -t babi:task10k:1 in the terminal i get PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'J:\AI\ParlAI\data\bAbI\babi.tar.gz' error. it first downloads the file and then it shows the error it also happnes even when i change the interpreter to conda python 3.6

cloned the repo, installed the requirements and torch 1.4, ran the setup.py develop command and then when i try the command above or even go the python parlai/scripts/safe_interactive.py -t blended_skill_talk -mf zoo:blender/blender_3B/model command it just downloads the file and always gives the same error also the same error happens on my laptop as well.

full terminal paste: 22:47:26 | Opt: 22:47:26 | allow_missing_init_opts: False 22:47:26 | batchsize: 1 22:47:26 | datapath: J:\AI\ParlAI\data 22:47:26 | datatype: train:ordered 22:47:26 | dict_class: None 22:47:26 | display_ignore_fields: agent_reply 22:47:26 | display_verbose: False 22:47:26 | download_path: None 22:47:26 | dynamic_batching: None 22:47:26 | hide_labels: False 22:47:26 | image_cropsize: 224 22:47:26 | image_mode: raw 22:47:26 | image_size: 256 22:47:26 | init_model: None 22:47:26 | init_opt: None 22:47:26 | loglevel: info 22:47:26 | max_display_len: 1000 22:47:26 | model: None 22:47:26 | model_file: None 22:47:26 | multitask_weights: [1] 22:47:26 | num_examples: 10 22:47:26 | override: "{'task': 'babi:task10k:1'}" 22:47:26 | parlai_home: J:\AI\ParlAI 22:47:26 | starttime: Oct10_22-47 22:47:26 | task: babi:task10k:1 22:47:26 | creating task(s): babi:task10k:1 [building data: J:\AI\ParlAI\data\bAbI] 22:47:26 | Downloading http://parl.ai/downloads/babi/babi.tar.gz to J:\AI\ParlAI\data\bAbI\babi.tar.gz Downloading babi.tar.gz: 0.00B [00:00, ?B/s] Traceback (most recent call last): File "j:\ai\parlai\parlai\core\worlds.py", line 1211, in _create_task_agents task_agents = my_module.create_agents(opt) # type: ignore AttributeError: module 'parlai.tasks.babi.agents' has no attribute 'create_agents'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\User\anaconda3\Scripts\parlai-script.py", line 33, in sys.exit(load_entry_point('parlai', 'console_scripts', 'parlai')()) File "j:\ai\parlai\parlai__main.py", line 14, in main superscript_main() File "j:\ai\parlai\parlai\core\script.py", line 280, in superscript_main return SCRIPT_REGISTRY[cmd].klass._run_from_parser_and_opt(opt, parser) File "j:\ai\parlai\parlai\core\script.py", line 89, in _run_from_parser_and_opt return script.run() File "j:\ai\parlai\parlai\scripts\display_data.py", line 109, in run return display_data(self.opt) File "j:\ai\parlai\parlai\scripts\display_data.py", line 71, in display_data world = create_task(opt, agent) File "j:\ai\parlai\parlai\core\worlds.py", line 1262, in create_task world = create_task_world(opt, user_agents, default_world=default_world) File "j:\ai\parlai\parlai\core\worlds.py", line 1226, in create_task_world task_agents = _create_task_agents(opt) File "j:\ai\parlai\parlai\core\worlds.py", line 1214, in _create_task_agents return create_task_agent_from_taskname(opt) File "j:\ai\parlai\parlai\core\teachers.py", line 2364, in create_task_agent_from_taskname task_agents = teacher_class(opt) File "j:\ai\parlai\parlai\tasks\babi\agents.py", line 71, in init opt['datafile'] = _path('-10k', self.task_num, opt) File "j:\ai\parlai\parlai\tasks\babi\agents.py", line 15, in _path build(opt) File "j:\ai\parlai\parlai\tasks\babi\build.py", line 35, in build downloadable_file.download_file(dpath) File "j:\ai\parlai\parlai\core\build_data.py", line 91, in download_file untar(dpath, self.file_name) File "j:\ai\parlai\parlai\core\build_data.py", line 254, in untar return _untar(path, fname, delete=delete) File "j:\ai\parlai\parlai\core\build_data.py", line 295, in _untar PathManager.rm(fullpath) File "C:\Users\User\anaconda3\lib\site-packages\fvcore\common\file_io.py", line 791, in rm return self.get_path_handler(path)._rm( # type: ignore File "C:\Users\User\anaconda3\lib\site-packages\fvcore\common\file_io.py", line 467, in _rm os.remove(path) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'J:\AI\ParlAI\data\bAbI\babi.tar.gz'

if someone has an idea what could be causing it?

SEMTEX99 commented 4 years ago

yeah a fix is just to remove the os.remove(filepath) line in FVcore file_io.py its in line 467, a crude fix but hey it works