kohya_ss icon indicating copy to clipboard operation
kohya_ss copied to clipboard

kohya gui finetune: [WinError 2] The system cannot find the file specified

Open nub2927 opened this issue 2 years ago • 5 comments

gui fails to create caption and latent metadata fails at merge_captions_to_metadata.py traceback:

Traceback (most recent call last): File "W:\kohya\venv\lib\site-packages\gradio\routes.py", line 321, in run_predict output = await app.blocks.process_api( File "W:\kohya\venv\lib\site-packages\gradio\blocks.py", line 1015, in process_api result = await self.call_function(fn_index, inputs, iterator, request) File "W:\kohya\venv\lib\site-packages\gradio\blocks.py", line 856, in call_function prediction = await anyio.to_thread.run_sync( File "W:\kohya\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "W:\kohya\venv\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "W:\kohya\venv\lib\site-packages\anyio_backends_asyncio.py", line 867, in run result = context.run(func, *args) File "W:\kohya\2nd\finetune_gui.py", line 268, in train_model subprocess.run(run_cmd) File "W:\kohya\python\Lib\subprocess.py", line 501, in run with Popen(*popenargs, **kwargs) as process: File "W:\kohya\python\Lib\subprocess.py", line 966, in init self._execute_child(args, executable, preexec_fn, close_fds, File "W:\kohya\python\Lib\subprocess.py", line 1435, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] The system cannot find the file specified

nub2927 avatar Jan 21 '23 12:01 nub2927

Hi, this is usually related to an installation issue. Make sure you do not have python modules installed locally that could conflict with the ones installed in the venv:

  1. Open a new powershell terminal and make sure no venv is active.
  2. Run the following commands
pip freeze > uninstall.txt
pip uninstall -r uninstall.txt

Then redo the installation instruction within the kohya_ss venv.

bmaltais avatar Jan 22 '23 15:01 bmaltais

Hi, this is usually related to an installation issue. Make sure you do not have python modules installed locally that could conflict with the ones installed in the venv:

1. Open a new powershell terminal and make sure no venv is active.

2. Run the following commands
pip freeze > uninstall.txt
pip uninstall -r uninstall.txt

Then redo the installation instruction within the kohya_ss venv.

same problem arises even after installing this, this is on its own venv without anything else being used

nub2927 avatar Jan 30 '23 13:01 nub2927

what python version is this proven to run on?

nub2927 avatar Jan 31 '23 15:01 nub2927

Hi, this is usually related to an installation issue. Make sure you do not have python modules installed locally that could conflict with the ones installed in the venv:

1. Open a new powershell terminal and make sure no venv is active.

2. Run the following commands
pip freeze > uninstall.txt
pip uninstall -r uninstall.txt

Then redo the installation instruction within the kohya_ss venv.

same problem arises even after installing this, this is on its own venv without anything else being used

Humm... I wonder if the issue is not related to spaces in the file path... Let me check the code... Are you running from a powershell script or a CDM window? The error almost make it appear as if it is not finding the file specified... What happen if you manually run the command it is outputing before the error? the command should start with ./venv/Scripts/python.exe finetune/merge_captions_to_metadata.py Copy the whole thing and try to run it... does it work?

bmaltais avatar Feb 03 '23 21:02 bmaltais

Have very similar issue. Any breakthroughs?

derto42 avatar Feb 17 '23 05:02 derto42

Had this issue today, unsure what to do

SpacyRainbow avatar Aug 31 '23 02:08 SpacyRainbow

Had this issue today, unsure what to do

fixed it, windows protection blocked folder access. i allowed it and it worked

SpacyRainbow avatar Aug 31 '23 02:08 SpacyRainbow