首页 文章

theano.test()错误:test_grad GradientError:数值梯度和分析梯度超出容差

提问于
浏览
0

我在Ubuntu 14.04上安装了Theano 0.8.2,运行 theano.test() 并收到以下错误 .

这个错误的可能原因是什么?

================================================= =====================错误:test_grad(theano.tensor.tests.test_basic.ArctanhInplaceTester)--------------- -------------------------------------------------- ----- Traceback(最近一次调用最后一次):文件“/usr/local/lib/python2.7/dist-packages/theano/tensor/tests/test_basic.py”,第483行,在test_grad eps = _grad_eps)文件“/usr/local/lib/python2.7/dist-packages/theano/tests/unittest_tools.py”,第91行,在verify_grad T.verify_grad中(op,pt,n_tests,rng,* args,** kwargs)文件“/usr/local/lib/python2.7/dist-packages/theano/gradient.py”,第1709行,在verify_grad中abs_tol,rel_tol)GradientError:GradientError:数值梯度和分析梯度超出容差:在参数的第4位0,绝对 . 错误= 3.537018,绝对 . 公差= 0.010000 rel . 错误= 0.013429,相对tolerance = 0.010000异常args:以下输入发生错误:,[array([[[0.28898013,0.98691875,-0.37341487],[ - 0 . 83661169,-0.99454761,-0.57619613]],dtype = float32)],eps的值是:,无,out_type是:,无,测试arctanh_inplace :: normal:在以下输入上计算梯度时出错:[array([[0.28898013,0.98691875,-0.37341487],[ - 0.83661169,-0.99454761, - 0.57619613]],dtype = float32)] ========================================= =============================错误:test_grad(theano.tensor.tests.test_basic.ArctanhTester)------- -------------------------------------------------- ------------- Traceback(最近一次调用最后一次):文件“/usr/local/lib/python2.7/dist-packages/theano/tensor/tests/test_basic.py”,行483,在test_grad eps = _grad_eps)文件“/usr/local/lib/python2.7/dist-packages/theano/tests/unittest_tools.py”,第91行,在verify_grad T.verify_grad(op,pt,n_tests,rng) ,* args,** kwargs)文件“/usr/local/lib/python2.7/dist-p ackages / theano / gradient.py“,第1709行,在verify_grad中abs_tol,rel_tol)GradientError:GradientError:数值梯度和分析梯度超出容差:在参数0的位置4,abs . 错误= 3.537018,绝对 . 公差= 0.010000 rel . 错误= 0.013429,相对tolerance = 0.010000异常args:以下输入发生错误:,[array([[[0.28898013,0.98691875,-0.37341487],[ - 0 . 83661169,-0.99454761,-0.57619613]],dtype = float32)],eps的值是:,无,out_type是:,None,Test Elemwise {arctanh,no_inplace} :: normal:在以下输入上计算梯度时出错:[array([[0.28898013,0.98691875,-0.37341487],[ - 0.83661169] ,-0.99454761,-0.57619613]],dtype = float32)] ------------------------------------ ----------------------------------在7522.578s中测试21747测试失败(跳过= 84,错误= 2)

非常感谢 .

2 回答

  • 0

    我看到了同样的问题;降级到numpy 1.9.3(从1.11.3)也为我修好了 . 重新升级到1.11.3会带来问题,因此这似乎是最近的numpy版本中的一个错误 . 尽管如此,Frederic Bastien(Theano开发人员)建议错误可以忽略,并且似乎是一个具有过于严格的错误阈值的测试 .

  • 0

    我不知道为什么,但这就是我做的工作 .

    • 将numpy降级为1.9.x

    • 重新安装pandas,matplotlib,...

    • 重新安装theano

相关问题