Skip to content

Instantly share code, notes, and snippets.

@hiepph
Last active September 25, 2019 04:20
Show Gist options
  • Save hiepph/e15639f476ecad0d79537ae2cc4c3e97 to your computer and use it in GitHub Desktop.
Save hiepph/e15639f476ecad0d79537ae2cc4c3e97 to your computer and use it in GitHub Desktop.
Jupyter notebook tricks
# GPUs select
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="0"
# Auto-reload external modules
%load_ext autoreload
%autoreload 2
# Matplotlib
%matplotlib inline
import matplotlib.pyplot as plt
plt.rcParams['figure.figsize'] = (10, 20)
# Bokeh
from bokeh.io import output_notebook, show
output_notebook()
# Ignore warning
import warnings
warnings.filterwarnings('ignore')
# Change size
plt.rcParams["figure.figsize"] = (20,3)
# bind to 0.0.0.0, no browser, and different port
jupyter notebook --ip 0.0.0.0 --no-browser --port 6006
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment