This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove existing CuDA versions | |
sudo apt --purge remove "cublas*" "cuda*" | |
sudo apt --purge remove "nvidia*" | |
rm -rf /usr/local/cuda* | |
sudo apt-get autoremove && sudo apt-get autoclean | |
# Reboot to remove cached files | |
reboot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install build essentials | |
sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev | |
# Download CuDA from following path | |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb | |
# read as a DebianPackage | |
sudo apt-key adv - fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | |
sudo dpkg -i cuda-repo-ubuntu1804_10.0.130–1_amd64.deb | |
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | |
# install cuda-10.0 | |
sudo apt install cuda-10.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# copy the following files into the cuda toolkit directory. | |
echo 'export PATH=/usr/local/cuda-10.0/bin:$PATH' >> ~/.bashrc | |
echo 'export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc | |
reboot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download from following link: https://developer.nvidia.com/rdp/cudnn-archive | |
tar -xzvf cudnn-10.0-linux-x64-v7.4.2.24.tgz | |
sudo cp -P cuda/include/cudnn.h /usr/local/cuda-10.0/include | |
sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda-10.0/lib64/ | |
sudo chmod a+r /usr/local/cuda-10.0/lib64/libcudnn* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check the version of CuDA, CuDNN | |
nvcc -V | |
cat /usr/local/cuda/version.txt | |
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2 | |
cat /usr/include/cudnn.h | grep CUDNN_MAJOR -A 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.image as mpimg | |
import seaborn as sns | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import confusion_matrix | |
import itertools | |
from keras.utils.np_utils import to_categorical | |
from keras.models import Sequential |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load data and visualize the histogram | |
train = pd.read_csv("../input/train.csv") | |
test = pd.read_csv("../input/test.csv") | |
Y_train = train["label"] | |
X_train = train.drop(labels = ["label"],axis = 1) | |
g = sns.countplot(Y_train) | |
Y_train.value_counts() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
X_train.isnull().any().describe() | |
test.isnull().any().describe() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Normalize | |
X_train = X_train / 255.0 | |
test = test / 255.0 | |
#Reshape | |
X_train = X_train.values.reshape(-1,28,28,1) | |
test = test.values.reshape(-1,28,28,1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Y_train = to_categorical(Y_train, num_classes = 10) |
OlderNewer