Truncated Notebooks

All DL1 notebooks are truncated. “Notebook failed to load. The error was: “[sprintf] expecting number but found string” See error console for details.”

1 Like

same problem

Try doing a fresh clone - they’re working fine for me and look OK in github:

Yes, starting from scratch works:
rm -r fastai git clone https://github.com/fastai/fastai.git

tried several times in Ubuntu. Still same problem.
Everyhing works fine in Windows though.

@jeremy I tried deleting the fastai directory and started with a fresh clone. Still the same problem for all the ML and DL notebooks. I am on Ubuntu 18.04.

I encountered the same issue, and I think I resolved it.

I’m a Paperspace user with the standard fast.ai template Ubuntu machine. I set this up Oct 3 and was encountering this truncated notebooks issue.

The problem seems to be the versions of packages and other dependencies.

I found Fastai v0 install issues thread and discovered that conda activate didn’t work because conda was too old.

So, the solution at a high level is to:

  1. work from the latest code in the fastai repo
  2. update conda (and pip too, why not) and ensure you can run conda activate
  3. destroy the fastai conda environment
  4. setup the fastai conda enviroment
  5. re-configure the IP address for Jupyter Notebook

Some more detail:

  1. – update the repo

  2. – update conda and pip

# turn off the active environment
source deactivate
# update pip and conda
pip install pip -U
conda update conda

Now, you’ll need to update some lines in ~/.bashrc. When you try to conda activate, conda will tell you what to change. I updated the very tail of my ~/.bashrc to this:

# ...other stuff omitted
# Previous to conda 4.4, the recommended way to activate conda was to modify PATH in
# your ~/.bashrc file. But now, don't do that.
#export PATH=~/anaconda3/bin:$PATH
. /home/paperspace/anaconda3/etc/profile.d/conda.sh
conda activate fastai

3., 4. – re-setup the fastai environment

# remove the fastai env first
conda env remove -y -n fastai
# now, in the fastai repo, re-create it
cd $HOME/fastai
conda env create -f environment.yml

5.-- configure jupyter if needed

I encountered this: Jupyter notebook KeyError: ‘allow_remote_access’. The following fixed it:

jupyter notebook --generate-config ~/.jupyter/jupyter_notebook_config.py "c.NotebookApp.ip = '127.0.0.1'"

After all this, I’m able to launch notebooks without truncations, and I’m working off the all the up to date code in the repo, and the up to date dependencies.

10 Likes

Hello,

In Google Cloud I was having the same issue describe in nº 5.

It fixed for me too.

Thank you

I also find this problem in windows. The solution is clearn all outputs:
you can use nbclean(pip install nbclean)

then, this is a example:

import nbclean as nbc
path_original_notebook = 'D:/tyang/fastai/courses/dl1/lesson1_.ipynb'
path_save = 'D:/tyang/fastai/courses/dl1/lesson1_.ipynb'
ntbk = nbc.NotebookCleaner(path_original_notebook)
ntbk.clear('output')
ntbk.save(path_save)

Can someone please tell me how to solve this problem??
Deleting and then cloning is not working.
I am working with the fast.ai public template on a n Ubuntu System.

I used paperspace and had the same issues. Didn’t work until I destroyed and setup the fastai conda environment again.

This worked for me. Thank You. However, I cannot connect to the Jupyter Notebook from the browser. Please advise. Thank you

I was having the same issue so I upgraded my version of the “notebook” package by running “conda upgrade notebook”. This moved me from version 5.4 to version 5.7 and now everything is fine.