2017年11月22日星期三

pycharm 快捷键

快捷键: https://segmentfault.com/a/1190000005776418

我的逐步积累:
shift + F6 全局修改一个函数名或者变量名等

Ctrl + R     替换
Ctrl + Shift + F  全局查找
Ctrl + Shift + R  全局替换

tensorflow错误集

1. restore from checkpoint
    1.1 tensorflow.python.framework.errors_impl.InternalError: Unable to get element from the feed as bytes    此处表明文件目录不对

    1.2 export model 时出现:NotFoundError (see above for traceback): Key Modeffl/eval_net/l1/b1 not found in checkpoint
     [[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]
  在新建模型的时候在前面加上了name_scape和variable_scope,导致检查点文件里参数的名称和新建模型的名称不一致,故而不可恢复,因为在检查点文件中找不到对应的参数名称
故而,如果在train模型时前面加上了相应的name_scope或者variable_scope,那么在导出时候也要加上,以此保证参数名称的一致性

2. serving

    2.1  Invalid argument: Shape [?,62] is not fully defined

找到一个解决方案,但是不适合我,我用的是官网的方法
https://stackoverflow.com/questions/41346058/you-must-feed-a-value-for-placeholder-tensor-input-example-tensor-with-dtype-s 

我遇到这个问题是在export,serving和client的过程中.
花了整整一天 ,终于知道是什么错了.
原因是在模型中我们用的是placeholder为了接收输入的组件,在export的时候,我们存储模型的参数和规定模型的输入和输出.但是由于模型中的placeholder实际上并没有与export的输入产生关联,故而出错.所以会一直报shape[?,62] is not fully defined.
要解决这个问题.就需要知道如何讲s与export的inputs产生关联

发现是这个问题后,就很好解决了.
 (1).当模型的输入是作为参数时,在外部定义placeholder,然后指定模型参数为placeholder的值,关联了模型的输入与export定义的输入
 (2).当模型的输入是placeholder时,就需要直接将input指定为model.[输入placeholder名就行了]

2017年11月19日星期日

论文开题需要做的事情

持续更新

11月20-11月30

第一件事: 看各大知名workshop现如今的研究方向,对论文的研究方向有个大致的了解

第二件事: 确定是基于工程方向的文章,找往届的论文看看格式

12月1-12月30

第三件事:论文题目初定,有细节的地方尚待考量

dan,ddqn,duel dqn
https://blog.csdn.net/u013236946/article/details/73161586

2017年11月8日星期三

那些年,我看过的优秀代码

介于看代码很重要,从今天开始看代码:

1. github : tensorflow/nmt     仓库[https://github.com/tensorflow/nmt.git]
 主题:机器翻译
 网络:rnn,bi-rnn,deep n
 时间:
2017年11月20日 : 看完程序脉络和train过程

学到的东西
1.
import argparse
#创建一个命令解析器的句柄

parser = argparse.ArgumentParser()
#注册一个命令解析器参数类型,其中lambda v: v.lower()=="true"
#是代表一个匿名函数的实现,主要判断获取到的参数v转换成小写后是否等于true
parser.register("type", "bool", lambda v: v.lower() == "true")

2.add_argument里面参数的含义
http://blog.csdn.net/u013177568/article/details/62432761


在一月份结束时务必完成!  江山代有人才出,各领风骚数百年啊啊啊啊!
 (差不多看完2018/01/23)


2. Surprise     仓库【https://github.com/NicolasHug/Surprise.git】    主页【http://surpriselib.com/

 (差不多看完2018/01/25 ,做小组汇报)


3. KubeFlow  仓库【https://github.com/google/kubeflow】

2.flask[据说非常适合工程上的学习]

 

2017年11月6日星期一

leetcode 17

17.   Letter Combinations of a Phone Number Medium Given a string containing digits from   2-9   inclusive, return all possible l...