minimaxir / automl-gs

Provide an input CSV and a target field to predict, generate a model + code to run it.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FileNotFoundError: [WinError 2] The system cannot find the file specified

sametdumankaya opened this issue · comments

When I try to run the jupyter notebook that you provided on the link
https://github.com/minimaxir/automl-gs/blob/master/docs/automl_gs_tutorial.ipynb
I'm getting FileNotFoundError. Also, when I tried with a local csv file, I got the same error again.
Btw, my OS is Windows 10.

image

same here

It seems to call "python model.py .. "

printing cmd

call Popen with cmd: ['python3', 'model.py', '-d', 'c:\\temp\\x.csv', '-m', 'train', '-c', 'automl-gs']

and then fails possibly due to a missing model.pu

Yeah, probably. I added the shell=True argument to the Popen statement to see if it works, but it generated another FileNotFoundError.

Yes, I admit I did not test on Windows. I thought having os.path everywhere would be enough, but I suppose it's true the subprocess on Windows is a bit different, or the file path of the generated files is not correct.

Will try to look into.

commented

same questions,in window system,

Same here. Not a permissions issue, definitely seems like an issue with the path of the created model.py file (maybe?).

It's actually the python executable. Subprocess doesn't appear to check the PATH, per https://stackoverflow.com/a/32799942/2540707

I'm OK with using shell=True or another approach like what the referenced commit does with shutil.

commented

@minimaxir bug is closed?

I also have same issue


does anyone try google colab with TPU ?
automl_grid_search('train.csv','Survived',framework='tensorflow')
Solving a binary_classification problem, maximizing accuracy using tensorflow.

Modeling with field specifications:
PassengerId: numeric
Pclass: categorical
Name: ignore
Sex: categorical
Age: numeric
SibSp: categorical
Parch: categorical
Ticket: ignore
Fare: numeric
Cabin: categorical
Embarked: categorical



HBox(children=(IntProgress(value=0), HTML(value='')))



HBox(children=(IntProgress(value=0, max=20), HTML(value='')))



---------------------------------------------------------------------------

FileNotFoundError                         Traceback (most recent call last)

<ipython-input-15-2a49bf52604c> in <module>
----> 1 automl_grid_search('train.csv','Survived',framework='tensorflow')


~\Anaconda3\lib\site-packages\automl_gs\automl_gs.py in automl_grid_search(csv_path, target_field, target_metric, framework, model_name, context, num_trials, split, num_epochs, col_types, gpu, tpu_address)
     80 
     81         # Execute model training using the generated files.
---> 82         train_generated_model(cmd, num_epochs, train_folder, pbar_sub)
     83 
     84         # Load the training results from the generated CSV,


~\Anaconda3\lib\site-packages\automl_gs\utils_automl.py in train_generated_model(cmd, num_epochs, train_folder, pbar_sub)
    310 
    311     p = Popen(cmd, cwd=train_folder, stdout=PIPE, bufsize=1,
--> 312               universal_newlines=True) 
    313 
    314     for line in iter(p.stdout.readline, ""):


~\Anaconda3\lib\subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors)
    727                                 c2pread, c2pwrite,
    728                                 errread, errwrite,
--> 729                                 restore_signals, start_new_session)
    730         except:
    731             # Cleanup if the child failed starting.


~\Anaconda3\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session)
   1015                                          env,
   1016                                          os.fspath(cwd) if cwd is not None else None,
-> 1017                                          startupinfo)
   1018             finally:
   1019                 # Child is launched. Close the parent's copy of those pipe


FileNotFoundError: [WinError 2] The system cannot find the file specified

This should be fixed in 0.2.1. Upgrade and let me know if it works!

Also I have no idea how you would get a WinError on a TPU when TPUs do not work on Win. That may be fixed by 0.2.1 as well.

@minimaxir I upgraded automl-gs to 0.2.1, but the issue still persists. I am testing it on Windows 10, and I think the problem is here. There, the code is trying to read 'results.csv', but it hasn't written anything before. I hope this will help you troubleshoot (e.g., you delete 'results.csv' file in your development folder/workspace and see if automl_gs still works) so that it will help us who want to give this library a try. Thank you.

I installed this morning and the same results.csv error exists (Windows 10).

Tip: this may be happening because the training subprocess is crashing; if so, Jupyter/ipython/colab won't show exceptions from that because it's being run in a separate process.

If you run automl_gs on the command line, you should see the exception from the model.py subprocess (in addition to this exception), which might give you more insight into what's breaking.

The Jupyter Notebook also adds this, as far as errors go :- FileNotFoundError: [Errno 2] No such file or directory: 'encoders\pclass_encoder.json'

It does appear to be running from the [minconda] command line however, at least a basic trial.

Any updates on this issue? Also running into problems with it.

FileNotFoundError Traceback (most recent call last)
in
----> 1 import pandas as pd

~\pandas.py in
9 import os
10
---> 11 os.chdir("F:/titanic")
12 df=pd.read_csv('train.csv')
13 #df.head(5)

FileNotFoundError: [WinError 2] The system cannot find the file specified: 'F:/titanic'
it take old file which I make early

commented

You may want to check if your system is blocking access to the folder you are trying to make venv. for windows 10, Windows Security is by default protecting user's document folder from being accessed and will block those access, you may want to open Windows Security -> Virus & threat protection -> Protection history to allow access to the folder you are making venv at.

I was also getting the same error when I was running code in spyder. Then I checked and found that, ffmpeg is needed. When I installed it from code "conda install -c conda-forge ffmpeg" (for anaconda), my issue gets resolved.