<commit_before>---
layout: post
title: "Tensorflow: 启动"
categories: [blog ]
tags: [Tensorflow, ]
description:  
---
声明：本博客欢迎转发，但请保留原作者信息!                                      
作者: [曹文龙]                                                                 
博客： <https://cwlseu.github.io/>                                             

[TOC]

## 安装与启动

### install prepare tools

`sudo apt-get install virtualenv`
`sudo apt-get install python-pip python-dev python-virtualenv`

### 启动tensorflow虚拟环境
1. 第一次使用，创建tensorflow
`virtualenv --system-site-packages ~/tensorflow`
2. 创建tensorflow virtualenv

```sh
source ~/tensorflow/bin/activate  # If using bash
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.0rc1-cp27-none-linux_x86_64.whl
pip install --upgrade $TF_BINARY_URL
```
### 启动与关闭virtualenv
`source ~/tensorflow/bin/activate`
`deactivate`


## test using demo 
`python -c 'import os; import inspect; import tensorflow; print(os.path.dirname(inspect.getfile(tensorflow)))'`

`python -m tensorflow.models.image.mnist.convolutional`
[Tensorflow install](https://www.tensorflow.org/versions/r0.12/get_started/os_setup.html#overview)

## 参考资料<commit_msg><dev>update</dev><commit_after>---
layout: post
title: "Tensorflow: 启动"
categories: [blog ]
tags: [Tensorflow, ]
description:  
---
声明：本博客欢迎转发，但请保留原作者信息!                                      
作者: [曹文龙]                                                                 
博客： <https://cwlseu.github.io/>                                             

[TOC]

## 安装与启动

### install prepare tools

`sudo apt-get install virtualenv`
`sudo apt-get install python-pip python-dev python-virtualenv`

### 启动tensorflow虚拟环境
1. 第一次使用，创建tensorflow
`virtualenv --system-site-packages ~/tensorflow`
2. 创建tensorflow virtualenv

```sh
source ~/tensorflow/bin/activate  # If using bash
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.0rc1-cp27-none-linux_x86_64.whl
pip install --upgrade $TF_BINARY_URL
```
### 启动与关闭virtualenv
`source ~/tensorflow/bin/activate`
`deactivate`


## test using demo 
`python -c 'import os; import inspect; import tensorflow; print(os.path.dirname(inspect.getfile(tensorflow)))'`

`python -m tensorflow.models.image.mnist.convolutional`

## 参考资料
[Tensorflow install](https://www.tensorflow.org/versions/r0.12/get_started/os_setup.html#overview)
{'fraction_non_alphanumeric': 0.13078216989066443, 'fraction_numerical': 0.01345668629100084, 'mean_word_length': 2.8125, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5786871', 'n_tokens_mistral': 859, 'n_tokens_neox': 870, 'n_words': 147}