在 centos 环境中
0. 安装winscp , 上传文件到linux,
0.1 yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel
1, yum install python ( 可能是 3.5, 也可能是2.7,2.7 不能用,请删除2.7, 直接下载3.5 安装包)
安装python
下载python 3.5 , configure, make, make install
rm /usr/bin/python
ln -s /usr/local/bin/python3.5 /usr/bin/python
ln -s /usr/local/bin/pip3.5 /usr/bin/pip
python test.py (运行不了 tensorflow ) 2,下载 get-pip.py ( 3.5 以上自带pip)
3, python get-pip.py
如果是 python 2.7
4, 安装 tensorflow , 需要 1.0 以上版本, 如果国外服务器安装不了,就用:
pip install --upgrade tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple (目前是1.5版本)
采用国外服务器安装方法:
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
如果是 python 3.5
pip install --upgrade
https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.1-cp35-cp35m-linux_x86_64.whl
安装python
下载python 3.5 , configure, make, make install
rm /usr/bin/python
ln -s /usr/local/bin/python3.5 /usr/bin/python
5. yum 需要修改
这个是因为系统之前升级过python,原来版本是2.7,升级python3后,yum 调用python找不到2.7的版本了
有两个配置文件需要修改
/usr/bin/yum /usr/libexec/urlgrabber-ext-down分别将文件开头的声明路径改正确,改回2.7的版本
#! /usr/bin/env python2.7
5, PIL 用不了,所以安装image 库。
pip install image
python: /usr/bin/python /usr/bin/python2.7 /usr/lib/python2.7 /usr/lib64/python2.7 /usr/include/python2.7 /usr/share/man/man1/python.1.gz
如何安装cuda 在 ubuntu 上面
1. Installation of CUDA Toolkit (9.0)
[link](https://devtalk.nvidia.com/default/topic/1024915/install-cuda-9-on-ubuntu-16-04-with-the-runfile-and-pre-installed-drivers/)
2. Installation of cuDNN v7.0
[link](https://developer.nvidia.com/rdp/cudnn-download)
3. Installation of libcupti-dev library (7.5.18-0ubuntu1)
4. Installation of Tensorflow-GPU
关于tensorflow 的 checkpoint
https://zhuanlan.zhihu.com/p/33108465
了解protobuf , 了解 tfrecords 的Example 的定义,,最终才能理解tfrecords 的含义
TFRecords 文件的生成和读取
https://zhuanlan.zhihu.com/p/30830673 (有狗的文件方法,,)
如何分批读入tfrecords 数据
https://zhuanlan.zhihu.com/p/24698483
分布式执行原理:
http://blog.csdn.net/u012436149/article/details/53140869
http://blog.csdn.net/luodongri/article/details/52596780
分布式执行例子:
https://github.com/thewintersun/distributeTensorflowExample
python生成汉字图片字库 (baidu 一下可以pygame生成)
安装python 在 gb18030环境时候:
make python 3.5.5 的时候:
Fatal Python error: Py_Initialize: Unable to get the locale encoding
LookupError: unknown encoding: GB18030
在 ./configure 操作前,先进行配置
export LANG=zh_CN.UTF-8 export LANGUAGE=zh_CN.UTF-8tensorflow 的图像处理函数
https://blog.csdn.net/White_Idiot/article/details/78825341
二:需要切图的环境准备 opencv 3.5.5。
安装cmake 下载:
binary 的 cmake version 3.10.3,
解压后, 直接export = $path: cmake-dir/bin/
运行 cmake --version ,如果显示cmake version 3.10.3, 表示成功。
安装opencv (3.5.5 自动携带python-opencv)
解压缩,获得opencv-3.4.0的目录,
进入opencv的目录:
mkdir build
cd build cmake .. sudo make sudo make install2、修改profile文件: #vi /etc/profile 在里面加入: export PATH="python 的目录,"
tensorflow 最新版的 cpu版本:
https://pypi.python.org/pypi/tensorflow/1.7.0
gpu 版本:
https://pypi.python.org/pypi/tensorflow-gpu/1.7.0