Originally posted on: https://matheustguimaraes.com/blog/cuda-cudnn-ubuntu-installation
Update package lists, download and install NVIDIA driver
sudo apt-get update
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt install nvidia-410
#!/usr/bin/env python | |
from __future__ import print_function | |
import argparse | |
import numpy as np | |
import time | |
tt = time.time() | |
import cv2 | |
from grpc.beta import implementations |
Update package lists, download and install NVIDIA driver
sudo apt-get update
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt install nvidia-410
import tensorflow as tf | |
# The export path contains the name and the version of the model | |
tf.keras.backend.set_learning_phase(0) # Ignore dropout at inference | |
model = tf.keras.models.load_model('./inception.h5') | |
export_path = '../my_image_classifier/1' | |
# Fetch the Keras session and save the model | |
# The signature definition is defined by the input and output tensors | |
# And stored with the default serving key |
This is a list of hacks gathered primarily from prior experiences as well as online sources (most notably Stanford's CS231n course notes) on how to troubleshoot the performance of a convolutional neural network . We will focus mainly on supervised learning using deep neural networks. While this guide assumes the user is coding in Python3.6 using tensorflow (TF), it can still be helpful as a language agnostic guide.
Suppose we are given a convolutional neural network to train and evaluate and assume the evaluation results are worse than expected. The following are steps to troubleshoot and potentially improve performance. The first section corresponds to must-do's and generally good practices before you start troubleshooting. Every subsequent section header corresponds to a problem and the section is devoted to solving it. The sections are ordered to reflect "more common" issues first and under each header the "most-eas
#!/bin/bash | |
### steps #### | |
# Verify the system has a cuda-capable gpu | |
# Download and install the nvidia cuda toolkit and cudnn | |
# Setup environmental variables | |
# Verify the installation | |
### | |
### to verify your gpu is cuda enable check |
from keras import backend as K | |
from keras import regularizers, constraints, initializers, activations | |
from keras.layers.recurrent import RNN, Layer, _generate_dropout_mask, _generate_dropout_ones | |
from keras.engine import InputSpec | |
from keras.legacy import interfaces | |
import warnings | |
# Copied from original keras source | |
def _time_distributed_dense(x, w, b=None, dropout=None, |
# -*- coding: utf-8 -*- | |
""" | |
Created on Fri May 05 04:12:36 2017 | |
@author: ADubey4 | |
""" | |
from __future__ import unicode_literals, print_function | |
import gensim | |
from gensim.parsing import PorterStemmer |
from django import forms | |
from django.core.exceptions import ValidationError | |
from django.db import transaction | |
class InvalidInputsError(Exception): | |
def __init__(self, errors, non_field_errors): | |
self.errors = errors | |
self.non_field_errors = non_field_errors |