以前玩深度学习一直是用的theano和keras,做为谷粉不能不试一下大热的TensorFlow。首先安装起来。
TensorFlow的安装指南非常详细,我是python的anaconda环境,所以直接先创建一个新环境,创建前先更新一下conda
conda update conda
conda update anaconda
看一下目前计算机上有哪些环境
conda info --env
目前只有root环境,所以新建一个专门为TensorFlow的环境,并将root中的包克隆过来
conda create --name tensorflow --clone root
激活使用环境
source activate tensorflow
退出环境
source deactivate
使用pip来安装
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0-py2-none-any.whl
然后我们可以使用jupyter notebook来启动,下面是两个最简单的示例。
Sunday, November 27, 2016
Wednesday, November 16, 2016
GibbsLDA++ 使用记录
之前在centos下编译成功了,但是现在用的是ubuntu 16.04报错了
错误如下:
make -C src/ -f Makefile all
make[1]: Entering directory '/media/fanyangfeng/windoc/lecom/lecomwork/auto_feedback/lda/GibbsLDA++-0.2/src'
g++ -c -o utils.o utils.cpp
utils.cpp: In static member function ‘static int utils::parse_args(int, char**, model*)’:
utils.cpp:69:28: error: ‘atof’ was not declared in this scope
alpha = atof(argv[++i]);
^
utils.cpp:72:27: error: ‘atof’ was not declared in this scope
beta = atof(argv[++i]);
^
utils.cpp:75:24: error: ‘atoi’ was not declared in this scope
K = atoi(argv[++i]);
^
utils.cpp:78:29: error: ‘atoi’ was not declared in this scope
niters = atoi(argv[++i]);
^
utils.cpp:81:31: error: ‘atoi’ was not declared in this scope
savestep = atoi(argv[++i]);
^
utils.cpp:84:29: error: ‘atoi’ was not declared in this scope
twords = atoi(argv[++i]);
^
utils.cpp: In static member function ‘static int utils::read_and_parse(std::__cxx11::string, model*)’:
utils.cpp:270:41: error: ‘atof’ was not declared in this scope
pmodel->alpha = atof(optval.c_str());
^
utils.cpp:273:40: error: ‘atof’ was not declared in this scope
pmodel->beta = atof(optval.c_str());
^
utils.cpp:276:37: error: ‘atoi’ was not declared in this scope
pmodel->K = atoi(optval.c_str());
^
utils.cpp:279:37: error: ‘atoi’ was not declared in this scope
pmodel->M = atoi(optval.c_str());
^
utils.cpp:282:37: error: ‘atoi’ was not declared in this scope
pmodel->V = atoi(optval.c_str());
^
utils.cpp:285:41: error: ‘atoi’ was not declared in this scope
pmodel->liter = atoi(optval.c_str());
^
Makefile:17: recipe for target 'utils.o' failed
make[1]: *** [utils.o] Error 1
make[1]: Leaving directory '/media/fanyangfeng/windoc/lecom/lecomwork/auto_feedback/lda/GibbsLDA++-0.2/src'
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 2
在http://blog.sciencenet.cn/blog-425672-654209.html找到答案,解决办法
解决方法:
1). 在src/utill.cpp 文件头加入:
#include<stdio.h> #include<stdlib.h>
2). 在src/utill.h 文件头加入:
#include<stdlib.h>
3). 在src/lda.cp 文件头加入:
#include<stdio.h>
4). 重新make
Thursday, November 3, 2016
mysql导入数据,制定特定列的方式
I am running this MySQL command:
I am getting an error:
What am I doing wrong here?
| ||||
add a comment
|
http://dev.mysql.com/doc/refman/5.6/en/load-data.html shows the syntax. The clause naming columns goes after the IGNORE clause.
|
Tuesday, October 18, 2016
MySQL存储emoji表情报错
SET NAMES utf8mb4;
ALTER table table CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
ALTER TABLE phone MODIFY COLUMN desc_title VARCHAR(1024)
CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER table table CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
ALTER TABLE phone MODIFY COLUMN desc_title VARCHAR(1024)
CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
Wednesday, October 12, 2016
mysql识别字段中包含中文的方法
select
HEX('服务器无响应') REGEXP '^(..)*(E[4-9])'
参见http://stackoverflow.com/questions/9795137/how-to-detect-rows-with-chinese-characters-in-mysql
HEX('服务器无响应') REGEXP '^(..)*(E[4-9])'
参见http://stackoverflow.com/questions/9795137/how-to-detect-rows-with-chinese-characters-in-mysql
Tuesday, October 11, 2016
git push origin v0.1
git tag -a v0.1 -m "Relase version v0.1"
git push origin v0.1
Git 中的tag指向一次commit的id,通常用来给开发分支做一个标记,如标记一个版本号。
打标签
git tag -a v1.01 -m "Relase version 1.01"
注解:git tag 是打标签的命令,-a 是添加标签,其后要跟新标签号,-m 及后面的字符串是对该标签的注释。
提交标签到远程仓库git push origin -tags
注解:就像git push origin master 把本地修改提交到远程仓库一样,-tags可以把本地的打的标签全部提交到远程仓库。
删除标签
git tag -d v1.01
注解:-d 表示删除,后面跟要删除的tag名字
删除远程标签
git push origin :refs/tags/v1.01
注解:就像git push origin :branch_1 可以删除远程仓库的分支branch_1一样, 冒号前为空表示删除远程仓库的tag。
查看标签
git tag
或者
git tag -l
Subscribe to:
Posts (Atom)