Updated 4/11/2018
Here's my experience of installing the NVIDIA CUDA kit 9.0 on a fresh install of Ubuntu Desktop 16.04.4 LTS.
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| The regex patterns in this gist are intended to match any URLs, | |
| including "mailto:[email protected]", "x-whatever://foo", etc. For a | |
| pattern that attempts only to match web URLs (http, https), see: | |
| https://gist.github.com/gruber/8891611 | |
| """ | |
| ANY_URL_REGEX = r"""(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))""" |
| #!/usr/bin/env python | |
| import pyaudio | |
| import socket | |
| import sys | |
| FORMAT = pyaudio.paInt16 | |
| CHANNELS = 1 | |
| RATE = 44100 | |
| CHUNK = 4096 |
| import pyaudio | |
| import wave | |
| FORMAT = pyaudio.paInt16 | |
| CHANNELS = 2 | |
| RATE = 44100 | |
| CHUNK = 1024 | |
| RECORD_SECONDS = 5 | |
| WAVE_OUTPUT_FILENAME = "file.wav" | |
| # Keras==1.0.6 | |
| import numpy as np | |
| from keras.models import Sequential | |
| from keras.layers.recurrent import LSTM | |
| from keras.layers.core import TimeDistributedDense, Activation | |
| from keras.preprocessing.sequence import pad_sequences | |
| from keras.layers.embeddings import Embedding | |
| from sklearn.cross_validation import train_test_split | |
| from sklearn.metrics import confusion_matrix, accuracy_score, precision_recall_fscore_support |
| import codecs | |
| tagged_sentences = codecs.open("../data/data.txt", encoding="utf-8").readlines() | |
| print(tagged_sentences[0]) | |
| import ast | |
| import numpy as np | |
| from keras.layers import Dense, InputLayer, Embedding, Activation | |
| from keras.models import Sequential | |
| from keras.optimizers import Adam |
| #!/bin/bash | |
| ## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.2 in ubuntu 18.04 | |
| ### steps #### | |
| # verify the system has a cuda-capable gpu | |
| # download and install the nvidia cuda toolkit and cudnn | |
| # setup environmental variables | |
| # verify the installation | |
| ### |
| apt-get update && apt-get install -y \ | |
| sox \ | |
| curl \ | |
| libicu-dev \ | |
| g++ \ | |
| git \ | |
| python \ | |
| python-dev \ | |
| python-setuptools \ |
Updated 4/11/2018
Here's my experience of installing the NVIDIA CUDA kit 9.0 on a fresh install of Ubuntu Desktop 16.04.4 LTS.
| sudo apt-get purge cuda | |
| sudo apt-get purge libcudnn6 | |
| sudo apt-get purge libcudnn6-dev | |
| # resources for nvidia deb package. | |
| wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.0.176-1_amd64.deb | |
| wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb | |
| wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libcudnn7-dev_7.0.5.15-1+cuda9.0_amd64.deb | |
| wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libnccl2_2.1.4-1+cuda9.0_amd64.deb | |
| wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libnccl-dev_2.1.4-1+cuda9.0_amd64.deb |
| #!/usr/bin/env bash | |
| wget https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz | |
| tar xzf Python-3.6.9.tgz | |
| cd Pyhton-3.6.9 | |
| ./configure --enable-optimizations | |
| make -j 2 | |
| make altinstall |