2016-07-01 47 views
0

我在Ubuntu 14.04上安裝了Theano 0.8.2,運行了theano.test(),並且出現以下錯誤。theano.test()錯誤:test_grad GradientError:數字梯度和分析梯度超過容忍

這個錯誤的可能原因是什麼?

====================================================================== ERROR: test_grad (theano.tensor.tests.test_basic.ArctanhInplaceTester)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/theano/tensor/tests/test_basic.py", line 483, in test_grad eps=_grad_eps)
File "/usr/local/lib/python2.7/dist-packages/theano/tests/unittest_tools.py", line 91, in verify_grad
T.verify_grad(op, pt, n_tests, rng, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/theano/gradient.py", line 1709, in verify_grad abs_tol, rel_tol)
GradientError: GradientError: numeric gradient and analytic gradient exceed tolerance:
At position 4 of argument 0,
abs. error = 3.537018, abs. tolerance = 0.010000
rel. error = 0.013429, rel. tolerance = 0.010000
Exception args:
The error happened with the following inputs:, [array([[ 0.28898013, 0.98691875, -0.37341487],
[-0.83661169, -0.99454761, -0.57619613]], dtype=float32)],
The value of eps is:, None,
The out_type is:, None, Test arctanh_inplace::normal: Error occurred while computing the gradient on the following inputs: [array([[ 0.28898013, 0.98691875, -0.37341487],
[-0.83661169, -0.99454761, -0.57619613]], dtype=float32)]

====================================================================== ERROR: test_grad (theano.tensor.tests.test_basic.ArctanhTester) ---------------------------------------------------------------------- Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/theano/tensor/tests/test_basic.py", line 483, in test_grad eps=_grad_eps)
File "/usr/local/lib/python2.7/dist-packages/theano/tests/unittest_tools.py", line 91, in verify_grad T.verify_grad(op, pt, n_tests, rng, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/theano/gradient.py", line 1709, in verify_grad abs_tol, rel_tol)
GradientError: GradientError: numeric gradient and analytic gradient exceed tolerance:
At position 4 of argument 0,
abs. error = 3.537018, abs. tolerance = 0.010000
rel. error = 0.013429, rel. tolerance = 0.010000
Exception args:
The error happened with the following inputs:, [array([[ 0.28898013, 0.98691875, -0.37341487],
[-0.83661169, -0.99454761, -0.57619613]], dtype=float32)],
The value of eps is:, None,
The out_type is:, None, Test Elemwise{arctanh,no_inplace}::normal: Error occurred while computing the gradient on the following inputs: [array([[ 0.28898013, 0.98691875, -0.37341487], [-0.83661169, -0.99454761, -0.57619613]], dtype=float32)]

----------------------------------------------------------------------
Ran 21747 tests in 7522.578s

FAILED (SKIP=84, errors=2)

非常感謝。

回答

0

我不知道爲什麼,但這是我做的工作。

  1. 降級numpy的的1.9.x
  2. 重裝大熊貓,matplotlib,...
  3. 重裝theano
0

我看到了同樣的問題;降至1.9.3(來自1.11.3)對我來說也是固定的。重新升級到1.11.3帶來了問題,所以這似乎是在更新的numpy版本中的錯誤。儘管有https://groups.google.com/forum/#!msg/theano-users/zyFc2DXMvpE/eblGjoa9AwAJ,其中Frederic Bastien(Theano開發者)建議可以忽略該錯誤,並且似乎是一個嚴格錯誤閾值的測試。