本步骤能实现用Intel核芯显卡来进行显示, 用NVIDIA GPU进行计算。
安装开发所需要的一些基本包
sudo apt-get install build-essential
sudo apt-get install vim cmake git
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev
#in the name of Allah, the most compassionate the most merciful | |
#run this scrip under python2. python3 would work, but not prefectly. e.g. running this script and setting oversample to true in | |
#net.predict([input_image], oversample=True) will cause a crash. but it works just fine under python2. | |
import numpy as np | |
import os, sys, getopt | |
# Main path to your caffe installation | |
caffe_root = '/path/to/your/caffe/' | |
# Model prototxt file |
# Typical setup to include TensorFlow. | |
import tensorflow as tf | |
# Make a queue of file names including all the JPEG images files in the relative | |
# image directory. | |
filename_queue = tf.train.string_input_producer( | |
tf.train.match_filenames_once("./images/*.jpg")) | |
# Read an entire image file which is required since they're JPEGs, if the images | |
# are too large they could be split in advance to smaller files or use the Fixed |
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# Author: Axel Angel, copyright 2015, license GPLv3. | |
# added mean subtraction so that, the accuracy can be reported accurately just like caffe when doing a mean subtraction | |
# Seyyed Hossein Hasan Pour | |
# [email protected] | |
# 7/3/2016 | |
import sys |
layers { | |
name: "conv1A" | |
type: CONVOLUTION | |
bottom: "data" | |
top: "conv1A" | |
blobs_lr: 1 | |
blobs_lr: 2 | |
weight_decay: 1 | |
weight_decay: 0 | |
convolution_param { |