This project is the code repository for Natural Language Processing with TensorFlow, Second Edition.
You can run these notebooks on cloud platforms like Google Colab or your local machine. Note that some chapters require a GPU to run in a reasonable amount of time, so we recommend one of the cloud platforms as they come pre-installed with CUDA.
- Install the latest NVIDIA driver for your GPU from this page
- Install CUDA 10.2 (TensorFlow 2.3)
- Setup CuDNN
- Make sure your $PATH variable contains the path to the bin folder of cuda (e.g. On Windows - C:\CUDA\v10.2\bin)
- On UNIX - Set LD_LIBRARY_PATH to
lib64
folder (e.g./usr/local/cuda-10.2/lib64
)
- On UNIX - Set LD_LIBRARY_PATH to
- Install Anaconda
- Open up Anaconda Prompt
- Setup a conda virtual environment with
conda create -n packt.nlp.2 python=3.6
- Activate the environment with
conda activate packt.nlp.tf2
- Install the required libraries using
pip install -r requirements.txt
- For some plotting capability provided in TensorFlow/Keras, you have installed a Python package called
graphviz
. You might need to add the path to this library (e.g.<path to Anaconda>\envs\packt.nlp.tf2\Library\bin\graphviz
if you used Anaconda installation)
Now you are ready to run the Jupyter notebook server, allowing you to run the notebooks provided in the code repository.
- Open up the command line terminal and activate the virtual environment
packt.nlp.tf2
if you haven't already - Go in to the directory you downloaded code to using
cd
in the CLI (e.g.cd C:\Users\<user>\Documents\code\packt_nlp_tensorflow_2
) - Run
jupyter notebook
in the CLI - This should open up the jupyter notebook server's landing page on your default browser
- Now you can navigate the folder structure within that directory, open any notebook and run it.