Live coding 4

I’m not particularly likely to cover this since most of the time I think this isn’t a good practice.

1 Like

Hi, I think I managed to properly execute everything so far (phew) but whenever I fire up a new server, my default folder is root (and so my left pane that shows the current of the current directory is empty). I am able to cd into notebooks and storage, but when I print their current folder using pwd, I only get " /notebooks#" so I’m not sure how to get the full path. I noticed Jeremy’s default folder is /notebooks if I’m not mistaken, whenever he fired up a new instance, at least in the left pane.

See this post

It is because we did not change the directory back to /notebooks in pre-run.sh. Jeremy address it in the next video.

3 Likes

@jeremy it’s in this lesson you faced issue of notebooks not showing up in paperspace. The fix was mentioned at start of lesson 5

3 Likes

I think it was right around there… Walkthru 4 - YouTube

1 Like

I posted almost the same under walkthru 5. :rofl: But i think this is the first one.

1 Like

I am getting an error with “Start Machine”, with nothing in logs to help troubleshoot.

I created a new project containing a new notebook, and the error remains.

I wonder if there is an error in my pre-run.sh file, but I can’t find how to browse to that file to edit it, and I can’t get a terminal until the machine starts. So I’m stuck.
Any hints how to review my /storage folder without starting a machine?

1 Like

If you fire up a “non fastai” instance, like a regular pytorch or just a CPU instance, it won’t try to run pre-run.sh but you’ll still get /storage/ attached to that instance.

HTH

3 Likes

Thanks Mike, That worked to get a terminal. However my pre-run.sh ran fine from the shell. And subsequent new fast.ai notebooks started okay. So the cause of the error is unknown, but also no longer a problem.

btw, this is the working pre-run.sh script I ended up with…

#!/usr/bin/env bash

mkdir -p /storage/cfg/.local/
mkdir -p -m 700 /storage/cfg/.ssh/

pushd /root
rm -rf .local
ln -s /storage/cfg/.local/
rm -rf .ssh
ln -s /storage/cfg/.ssh/
popd

This can be run before ssh keys are uploaded, so those will automatically end up in persistent storage without having to manually move them.

2 Likes

Yep, as soon I saw Jeremy’s message. Since I attended all sessions live so far, I was remembered it was lesson 3,4,5 something. With chapter markers was able to find it quickly :hugs:

Since we have access to git and ability to install a run-hook in pre-run.sh, I’d probably just host my config files in a private git repo, have pre-run.sh do the bare minimum to get that functionality going (like set the ssh keys etc,) and then clone my config including all the bash scripts etc from github and execute that. This way, if I break something, I can fix it without having to fire up a paperspace cpu only instance.

Also, paperspace doesn’t give us the output of the pre-run.sh script; if it did, we could look at it and see what might have gone wrong with the script’s execution.

You could have pre-run.sh do nothing but run another script and pipe it to tee.

2 Likes

I think it would be a good idea to put a note on Walk-thru 3 regarding setting up persistent config in paperspace such that people can directly go to Walk-thru 4 if they are interested.

BTW, I really love the pace of this walkthrough.

1 Like

Please feel free to add that note! All the walkthru topics are wikis so you can edit them.

I like to use automated setup method.

It seem it will do most of stuff from lecture 3 to 7 (before gaggle competition). I watched lectures 2 times at lease and tried to figure it out, I could not. So I decided to delete my project in paperspace and do automated setup. However , I do not know what else I need to do to finish the setup properly. Logically after cloning paperspace-setup I definitely need to upload my SSH keys where ? I do not know or or storage/.ssh )
It seems it automate every setup and installation from live session 3 , 4 , 5 and 6 then I go continue from Live session 7 ? or I need to install other stuff after paperspace-setup?
Anyone could help it would be great. I am so stuck on installations on paperspace.
So far I deleted the files that Jeremy said and did not create SSH keys yet.

1 Like

I added some package installation to setup.sh to make it a bit more turnkey…
(note, the “pv” package is not required for the course)

Apart from SSH setup, you may also want to you Kaggle key. Sorry its too long ago to remember anything else.

1 Like

Thanks man. That is awesome. I can not do locally , I don’t have GPU however I installed in locally yesterday (maybe useful for other stuff).

pipi -U fastai

Install this on home or notebook directory ?

running it from home or notebook directory doesn’t matter. The “–user”" flag will always install to your home directory.

alias pipi='pip install --user '
1 Like

Does any one have issue with python on paperspace recently / today? I was following the walk-thrus and all was fine for the past few days until just now, got this error.

Find the same issue when using a new notebook / a new project

I raised a ticket with Paperspace but want to check if anyone else got this issue

# in a fastai.ai notebook in a fresh project
root@nmbqooxlqj:/notebooks# python
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = '/root/.conda/bin/python3.11'
  isolated = 0
  environment = 1
  user site = 1
  safe_path = 0
  import site = 1
  is in build tree = 0
  stdlib dir = '/root/.conda/lib/python3.11'
  sys._base_executable = '/root/.conda/bin/python3.11'
  sys.base_prefix = '/root/.conda'
  sys.base_exec_prefix = '/root/.conda'
  sys.platlibdir = 'lib'
  sys.executable = '/root/.conda/bin/python3.11'
  sys.prefix = '/root/.conda'
  sys.exec_prefix = '/root/.conda'
  sys.path = [
    '/root/.conda/lib/python311.zip',
    '/root/.conda/lib/python3.11',
    '/root/.conda/lib/python3.11/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f16e29f0740 (most recent call first):
  <no Python frame>

[UPDATE] I learned that in Paperspace, all notebooks under any projects have access to /storage. That’s why had this same issue even when I created a new notebook in a new project.

After removing pre-run.sh, the issue disappears. So I guess I messed up the setup somewhere, going to retry, at least this mysterious issue is now resolved

Hi, I am not having any issue when I was following the live coding today.
Did you change pre-run.sh that may cause this problem?

1 Like