OSError: [WinError 126] The specified module could not be found. Error loading “c:\users\admin\desktop\fastbook\venv36\lib\site-packages\torch\lib\caffe2_detectron_ops_gpu.dll” or one of its dependencies.
BrokenPipeError: [Errno 32] Broken pipe
TypeError: blank() got an unexpected keyword argument ‘disable’
UnicodeEncodeError: ‘charmap’ codec can’t encode characters in position 70924-70950: character maps to <undefined>
DLL load failed: The paging file is too small for this operation to complete*
NameError: name ‘log_args’ is not defined
I experienced a half dozen errors while using a virtual environment to complete the 01_intro and 02_production notebook files in the fastbook library on Windows 10. The errors were related to parallel computing issues, version conflicts, encoding errors, and memory issues. I troubleshot each error individually but they could’ve been avoided altogether by having the right installation instructions.
The following instructions create a virtual environment, install the fastbook requirements in the virtual environment, and install the virtual environment in the list of available kernels in Jupyter Notebook.
git clone --recursive https://github.com/fastai/fastbook.git
cd fastbook
python -m pip install virtualenv
python -m virtualenv venv
venv\scripts\activate
python -m pip install torch==1.7.1 --find-links https://download.pytorch.org/whl/torch_stable.html --no-cache-dir
python -m pip install torchvision==0.8.2 --find-links https://download.pytorch.org/whl/torch_stable.html --no-cache-dir
python -m pip install --upgrade fastai==2.2.7 --no-cache-dir
python -m pip install --upgrade fastbook --no-cache-dir
python -m pip install graphviz --no-cache-dir
venv\scripts\python -m ipykernel install --name "fastai-pytorch" --display-name "FastAI (PyTorch)"
The instructions assume that your programming environment is already set up. It’s much easier to use cloud services like Gradient by Paperspace, Collaboratory by Google, or Kernels by Kaggle. However, if you’re going to set up your own programming environment then you can reference the following articles:
Linux:
- Install and Manage Multiple Python Versions
- Install the NVIDIA CUDA Driver, Toolkit, cuDNN, and TensorRT
- Install the Jupyter Notebook Server
- Install Virtual Environments in Jupyter Notebook
- Install the Python Environment for AI and Machine Learning
WSL2:
- Install Windows Subsystem for Linux 2
- Install and Manage Multiple Python Versions
- Install the NVIDIA CUDA Driver, Toolkit, cuDNN, and TensorRT
- Install the Jupyter Notebook Server
- Install Virtual Environments in Jupyter Notebook
- Install the Python Environment for AI and Machine Learning
- Install Ubuntu Desktop With a Graphical User Interface
Windows 10:
- Install and Manage Multiple Python Versions
- Install the NVIDIA CUDA Driver, Toolkit, cuDNN, and TensorRT
- Install the Jupyter Notebook Server
- Install Virtual Environments in Jupyter Notebook
- Install the Python Environment for AI and Machine Learning
MacOS: