This file contains hidden or 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
# first get the PPA repository driver | |
sudo add-apt-repository ppa:graphics-drivers/ppa | |
# install nvidai driver | |
sudo apt install nvidia-384 nvidia-384-dev | |
# install other import packages | |
sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev | |
# CUDA 9 requires gcc 6 |
This file contains hidden or 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
# CMAKE FILE to separatly compile cuda and c++ files | |
# with the c++11 standard | |
# | |
# | |
# Folder structure: | |
# | |
# | | |
# +--main.cpp (with C++11 content) | |
# +--include/ | |
# | | |
This file contains hidden or 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 needed packages | |
import torch | |
import torch.nn as nn | |
from torchvision.transforms import transforms | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from torch.autograd import Variable | |
from torchvision.models import squeezenet1_1 | |
import torch.functional as F | |
import requests |
This file contains hidden or 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
#coding=utf-8 | |
import sys | |
import json | |
import time | |
import random | |
import requests | |
import platform | |
import traceback | |
import subprocess |
This file contains hidden or 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
#ifndef CUDA_STRING_H | |
#define CUDA_STRING_H | |
/* Provide an uniform cuda string library. | |
All following functions can be found by internet. | |
*/ | |
__device__ bool c_strcmp(const char *a, const char *b, unsigned l) { | |
for (int i = 0; i< l; i++) | |
if (a[i] != b[i]) return false; |
This file contains hidden or 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 click | |
import torch | |
import torch.autograd | |
import torch.nn.functional as F | |
from torch.autograd import Variable | |
import os | |
import random | |
import math |