本文讲解如何使用TensorFlow Severing落地一个训好的模型。
# 从https://github.com/bazelbuild/bazel/releases下载bazel安装包
cd ~/Downloads
chmod +x bazel-0.4.5-installer-linux-x86_64.sh
./bazel-0.4.5-installer-linux-x86_64.sh --user
#!/bin/sh | |
# Usage: gdblive [ arguments to grep output of ps ] | |
cd $HOME | |
# tee /dev/tty is for user to see the set of procs considered | |
if [ $# -eq 0 ] | |
then | |
PROCS=`ps auxww | \ |
#!/bin/bash | |
#=============================================================================== | |
# | |
# FILE: getgeo.sh | |
# | |
# USAGE: ./getgeo.sh | |
# | |
# DESCRIPTION: run the script so that the geodata will be downloaded and inserted into your | |
# database | |
# |
#include <iostream> | |
#include <boost/uuid/uuid.hpp> | |
#include <boost/uuid/uuid_generators.hpp> | |
#include <boost/uuid/uuid_io.hpp> | |
#include <boost/lexical_cast.hpp> | |
#include <boost/range/iterator_range.hpp> |
#include <iostream> | |
#include <sstream> | |
#include <string> | |
#include <ctime> | |
#include <glog/logging.h> | |
#include <msgpack.hpp> | |
#include <pficommon/text/json.h> | |
#include <pficommon/network/socket.h> |
#include <cuda_runtime.h> | |
#include <cstring> | |
#include <cstdlib> | |
#include <vector> | |
#include <string> | |
#include <iostream> | |
#include <stdio.h> | |
#include "caffe/caffe.hpp" |
global ptr2bt | |
global ptr2size | |
global bt_stats | |
global quit | |
probe begin { | |
warn("Start tracing. Wait for 10 sec to complete.\n") | |
} | |
probe process("/lib/x86_64-linux-gnu/libc.so.6").function("malloc").return { |
First, you have to enable profiling
> db.setProfilingLevel(1)
Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...
#!/bin/sh | |
# | |
# Script prints gdb stack of the process with a specified pid | |
if [ -z $1 ]; then | |
echo "Usage: $0 pid" | |
exit 1 | |
fi | |
PID=$1 |
#include <boost/thread.hpp> | |
#include <boost/asio.hpp> | |
#include <memory> | |
#include <atomic> | |
#include <sys/resource.h> | |
using namespace boost::asio; | |
using namespace boost::asio::ip; | |
using boost::system::error_code; | |
using std::shared_ptr; |