Here's my experience of installing the NVIDIA CUDA kit 8.0 on a fresh install of Ubuntu Desktop 16.04.3 LTS.
import cv2 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# create a simple image | |
image = np.kron([[1, 0] * 4, [0, 1] * 4] * 4, np.ones((50, 50))).astype(np.uint8) * 255 | |
# test opencv | |
cv2.imshow('checkboard',image) | |
cv2.waitKey(0) | |
# test matplotlib |
=> creating model 'simplenetv1_imagenet_3p' | |
=> Model : simplenetv1_imagenet_3p( | |
(features): Sequential( | |
(0): Conv2d(3, 64, kernel_size=[3, 3], stride=(2, 2), padding=(1, 1)) | |
(1): BatchNorm2d(64, eps=1e-05, momentum=0.05, affine=True) | |
(2): ReLU(inplace) | |
(3): Conv2d(64, 128, kernel_size=[3, 3], stride=(2, 2), padding=(1, 1)) | |
(4): BatchNorm2d(128, eps=1e-05, momentum=0.05, affine=True) | |
(5): ReLU(inplace) | |
(6): Conv2d(128, 128, kernel_size=[3, 3], stride=(1, 1), padding=(1, 1)) |
#!/bin/bash | |
## Bash script for setting up ROS Neotic (with Gazebo 9) development environment for PX4 on Ubuntu LTS (20.04). | |
## It installs the common dependencies for all targets (including Qt Creator) | |
## | |
## Installs: | |
## - Common dependencies libraries and tools as defined in `ubuntu_sim_common_deps.sh` | |
## - ROS Melodic (including Gazebo9) | |
## - MAVROS |
#!/bin/bash | |
## Bash script for setting up a PX4 development environment on Ubuntu LTS (16.04 and above). | |
## It can be used for installing simulators (only) or for installing the preconditions for Snapdragon Flight or Raspberry Pi. | |
## | |
## Installs: | |
## - Common dependencies and tools for all targets (including: Ninja build system, latest versions of cmake, git, anaconda3, pyulog) | |
## - jMAVSim simulator dependencies | |
## - PX4/Firmware source (to ~/src/Firmware/) |
#!/usr/bin/python | |
# Author: SeyyedHossein Hasanpour copyright 2017, license GPLv3. | |
# Seyyed Hossein Hasan Pour: | |
# Coderx7@Gmail.com | |
# Changelog: | |
# 2015: | |
# initial code to calculate confusionmatrix by Axel Angel | |
# 7/3/2016:(adding new features-by-hossein) | |
# added mean subtraction so that, the accuracy can be reported accurately just like caffe when doing a mean subtraction |
Here is a gif showing how to do this from the beginning to the very end |
This file serves a BKM to get better performance on CPU for PyTorch, mostly focusing on inference or deployment. Chinese version available here.
layout
refers to how data is organized in a tensor. PyTorch default layout is NCHW
, from optimization perspective, MKL-DNN library (renamed as DNNL recently) may choose a different layout, sometimes refered to as internal layout or primitive layout. This is actually a normal technique for acceleration libraries, common knowledge is that NHWC
runs faster than NCHW
for convolution, changing the default NCHW
to NHWC
is called a reorder
. MKL-DNN may choose different internal layouts based on the input pattern and the algorithm selected, e.g. nChw16c
, a.k.a. reorder a 4-dim tensor into 5-dim by chop down dimension C by 16, for vectorization purpose (AVX512 instruction length is 16x32 bit).
By default on CPU, conv2d
will ru
package main | |
import ( | |
"github.com/kardianos/service" | |
"log" | |
"flag" | |
) | |
type Service struct {} |