lgone2000
lgone2000
https://github.com/PaddlePaddle/Paddle/blob/develop/doc/fluid/dev/use_eigen_cn.md 中 更多的转换方法请参考eigen_test.cc中的 “单元测试“ 单元测试链接 https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/framework/eigen_test.cc 目前为404. 新的代码地址应该是 paddle/fluid/framework/eigen_test.cc 建议 做一个文档中链接的自动检查,可以通过自动方式检查 文档中链接代码出现的死链。
ctest -R test_conv2d_op report error
在fluid.layers.tensor 里面找到save函数,不知道下面用法对不对 ``` def testsave(): x = fluid.layers.create_parameter(dtype="float32", shape=[5, 10], name="x") exe = fluid.Executor(fluid.CPUPlace()) exe.run(fluid.default_startup_program()) fluid.layers.tensor.save(x, 'x.data') ```
paddle使用中很难搞清楚出错信息的含义。 paddle 相当于 把 python 定义的网络 编译成了program, 但没保留任何调试信息。 结果运行时报了指令错误,没有对应到高层的语句和行号。遇到这种错误的时候, 基本靠猜,给出的上下文语义基本没什么线索, 对于不太懂内部原理的人来说。
import paddle.fluid as fluid 这句话执行了很长时间,能否降低这个加载时间呢? 对于调试程序,这个干扰很大。只要import fluid 什么都不做,都要等上一阵子
下面程序 如果flag = 1 使用 就报错,flag=0 就可以跑。 对loss加mean则都能跑。不加mean时,loss输出是一个数组,这时候 opt是怎么优化的呢? ``` def testtrain1(): flag = 1 place = fluid.CPUPlace() exe = fluid.Executor(place) main_program = fluid.default_main_program() x = fluid.layers.data(name='x', shape=[256], dtype='float32') y...
举个例子 paddle.fluid.layers.data paddle.fluid.layers.embedding paddle.fluid.layers.fc 三个定义接口定义如下,其中data 的name参数在最前面没有缺省值,embedding 没有name参数,fc有name参数放在最后,而且缺省值是None ``` def data(name, shape, append_batch_size=True, dtype='float32', lod_level=0, type=core.VarDesc.VarType.LOD_TENSOR, stop_gradient=True): def embedding(input, size, is_sparse=False, padding_idx=None, param_attr=None, dtype='float32'): def fc(input, size, num_flatten_dims=1, param_attr=None, bias_attr=None, use_mkldnn=False,...
根据文档,fc函数的bias_attr的参数设置为None时,不会生成bias参数,但实际测试发现生成了bias参数变量,请问这个正常吗? ``` def testfc(): place = fluid.CPUPlace() exe = fluid.Executor(place) x = fluid.layers.data(name='x', shape=[128], dtype='float32') fcout = fluid.layers.fc( name = 'testfc', input=x, size=2, bias_attr=None ) exe.run(fluid.default_startup_program()) for name,var in fluid.default_main_program().global_block().vars.iteritems():...
复现代码如下,testdist传入相同变量,testdist1 传入两个不同变量。输出结果相同。 第一个梯度并没有对输入变量累加。 公式推导真实值应该为[6,6] ``` def testdist(): # #input = [x;y] #ab= [x;y] * [x,y] = [x*x, x*y; x*y, y*y] #cost = x*x+2*x*y+y*y #dcost/dx = 2*x+2*y = 6 #dcost/dy =...