"No such file or directory" when creating Jupyter notebook from scratch
See original GitHub issueI’m running into a problem with a notebook I’ve created from scratch in Jupyter that I’m not getting with a with the included example hyperas/examples/simple_notebook.ipynb.
It appears that hyperas is looking for a temperary file that does not exist.
Any thoughts about what is going wrong?
Steps to recreate the error:
- Create new Jupyter notebook
- Copy the sample code from the hyperas README and pasted it into the notebook created in 1)
- Selected “Cell->Run All”
- Error is thrown: See below
- Selected “Kernel -> Restart and Run All”
- Error is thrown: same as 4)
- “File -> Save and Checkpoint”, “Kernel -> Restart and Run All”
- Error is thrown: same as 4) and 6)
Using TensorFlow backend.
/usr/local/lib/python2.7/dist-packages/hyperas/optim.py
/usr/local/lib/python2.7/dist-packages/hyperas/optim.py
/usr/local/lib/python2.7/dist-packages/hyperas/optim.py
<ipython-input-1-43ea71f3309d>
/usr/local/lib/python2.7/dist-packages/IPython/core/interactiveshell.py
/usr/local/lib/python2.7/dist-packages/IPython/core/interactiveshell.py
/usr/local/lib/python2.7/dist-packages/IPython/core/interactiveshell.py
/usr/local/lib/python2.7/dist-packages/ipykernel/zmqshell.py
/usr/local/lib/python2.7/dist-packages/ipykernel/ipkernel.py
/usr/local/lib/python2.7/dist-packages/ipykernel/kernelbase.py
/usr/local/lib/python2.7/dist-packages/ipykernel/kernelbase.py
/usr/local/lib/python2.7/dist-packages/ipykernel/kernelbase.py
/usr/local/lib/python2.7/dist-packages/tornado/stack_context.py
/usr/local/lib/python2.7/dist-packages/zmq/eventloop/zmqstream.py
/usr/local/lib/python2.7/dist-packages/zmq/eventloop/zmqstream.py
/usr/local/lib/python2.7/dist-packages/zmq/eventloop/zmqstream.py
/usr/local/lib/python2.7/dist-packages/tornado/stack_context.py
/usr/local/lib/python2.7/dist-packages/tornado/ioloop.py
/usr/local/lib/python2.7/dist-packages/zmq/eventloop/ioloop.py
/usr/local/lib/python2.7/dist-packages/ipykernel/kernelapp.py
/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py
/usr/local/lib/python2.7/dist-packages/ipykernel_launcher.py
/usr/lib/python2.7/runpy.py
/usr/lib/python2.7/runpy.py
---------------------------------------------------------------------------
IOError Traceback (most recent call last)
<ipython-input-1-43ea71f3309d> in <module>()
80 algo=tpe.suggest,
81 max_evals=5,
---> 82 trials=Trials())
83 X_train, Y_train, X_test, Y_test = data()
84 print("Evalutation of best performing model:")
/usr/local/lib/python2.7/dist-packages/hyperas/optim.pyc in minimize(model, data, algo, max_evals, trials, rseed, notebook_name, verbose)
40 best_run = base_minimizer(model=model, data=data, algo=algo, max_evals=max_evals,
41 trials=trials, rseed=rseed, full_model_string=None,
---> 42 notebook_name=notebook_name, verbose=verbose)
43
44 best_model = None
/usr/local/lib/python2.7/dist-packages/hyperas/optim.pyc in base_minimizer(model, data, algo, max_evals, trials, rseed, full_model_string, notebook_name, verbose, stack)
60 model_str = full_model_string
61 else:
---> 62 model_str = get_hyperopt_model_string(model, data, notebook_name, verbose, stack)
63 temp_file = './temp_model.py'
64 write_temp_files(model_str, temp_file)
/usr/local/lib/python2.7/dist-packages/hyperas/optim.pyc in get_hyperopt_model_string(model, data, notebook_name, verbose, stack)
126 print(i[1])
127 calling_script_file = os.path.abspath(inspect.stack()[stack][1])
--> 128 with open(calling_script_file, 'r') as f:
129 source = f.read()
130
IOError: [Errno 2] No such file or directory: '/work/models/regression/Keras-Nonlinear-Regression/<ipython-input-1-43ea71f3309d>'
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Error when executing `jupyter notebook` (No such file or ...
It seems to me as though the installation has messed up somehow. Try running: # For Python 2 pip install --upgrade --force-reinstall ...
Read more >[Errno 2] No such file or directory - Jupyter Community Forum
I've tried creating a shared folder for both the notebook and the CSV but the notebook still can't find the CSV file.
Read more >Opening files and reading from files
Here is likely the most common error you'll get when trying to open a file. FileNotFoundError: [Errno 2] No such file or directory:...
Read more >What to do when things go wrong - The Jupyter Notebook
If you're using a menu shortcut or Anaconda launcher to start it, try opening a terminal or command prompt and running the command...
Read more >FileNotFoundError: No such file or directory. This error occurs ...
I don't think you can easily change the path to your desktop since IBMQ's jupyter notebook is running on IBM's server, not your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you run your code in jupyter, function “optim.minimize” must contain a parameter “notebook_name”. As the example “simple_notebook.ipynb”:
This fix does not work in Google colab. Has anybody figured out how to run it in colab yet?