chainerrl icon indicating copy to clipboard operation
chainerrl copied to clipboard

TestCastObservation.test_cast_observation is flaky

Open muupan opened this issue 6 years ago • 0 comments

______________ TestCastObservation_param_0.test_cast_observation _______________
self = <chainer.testing.parameterized.TestCastObservation_param_0 testMethod=test_cast_observation>
    def test_cast_observation(self):
        env = chainerrl.wrappers.CastObservation(
            gym.make(self.env_id), dtype=self.dtype)
        rtol = 1e-3 if self.dtype == np.float16 else 1e-7
    
        obs = env.reset()
        self.assertEqual(env.original_observation.dtype, np.float64)
        self.assertEqual(obs.dtype, self.dtype)
>       np.testing.assert_allclose(env.original_observation, obs, rtol=rtol)
E       AssertionError: Parameterized test failed.
E       
E       Base test method: TestCastObservation.test_cast_observation
E       Test parameters:
E         dtype: <class 'numpy.float16'>
E         env_id: CartPole-v1
E       
E       AssertionError: 
E       Not equal to tolerance rtol=0.001, atol=0
E       
E       Mismatch: 25%
E       Max absolute difference: 1.0772385e-05
E       Max relative difference: 0.0021301
E        x: array([-3.641746e-02, -1.314095e-05, -3.944846e-02, -3.614351e-03])
E        y: array([-3.641e-02, -1.311e-05, -3.946e-02, -3.614e-03], dtype=float16)

https://travis-ci.org/chainer/chainerrl/jobs/577719191

muupan avatar Aug 28 '19 08:08 muupan