eric-haibin-lin opened a new issue #7317: check_numeric_grad with FullyConnected fails URL: https://github.com/apache/incubator-mxnet/issues/7317 For bugs or installation issues, please provide the following information. The more information you provide, the more likely people will be able to help you. ## Environment info Operating System: DL AMI Compiler: Package used (Python/R/Scala/Julia): MXNet version: Or if installed from source: MXNet commit hash (`git rev-parse HEAD`): 861e929cec8fa8fbab06884d9605debb74cd7217 If you are using python package, please provide Python version and distribution: If you are using R package, please provide R `sessionInfo()`: ## Error Message: Please paste the full error message, including stack trace. ``` /home/ubuntu/upstream-cpu/python/mxnet/test_utils.py:412: UserWarning: Calling forward the second time after forward(is_train=True) without calling backward first. Is this intended$ executor.forward(is_train=use_forward_train) /home/ubuntu/upstream-cpu/python/mxnet/test_utils.py:404: UserWarning: Calling forward the second time after forward(is_train=True) without calling backward first. Is this intended? executor.forward(is_train=use_forward_train) Traceback (most recent call last): File "./test.py", line 13, in <module> check_fully_connected((32, 100), 10) File "./test.py", line 11, in check_fully_connected check_numeric_gradient(test, location) File "/home/ubuntu/upstream-cpu/python/mxnet/test_utils.py", line 524, in check_numeric_gradient ("NUMERICAL_%s"%name, "BACKWARD_%s"%name)) File "/home/ubuntu/upstream-cpu/python/mxnet/test_utils.py", line 154, in assert_almost_equal raise AssertionError(msg) AssertionError: Items are not equal: Error 294.098633 exceeds tolerance rtol=0.010000, atol=0.000000. Location of maximum error:(19, 54), a=0.001162, b=0.000295 NUMERICAL_x: array([[ 3.73460722, 0.2527386 , -1.75657499, ..., -1.24495852, 0.74711072, -5.7607851 ], [ 2.94259191, -0.7109642 , -1.08036399, ..., -0.87466836,... BACKWARD_x: array([[ 3.7337687 , 0.25231028, -1.75907421, ..., -1.24670959, 0.74810255, -5.76152706], [ 2.94111443, -0.7087307 , -1.0836978 , ..., -0.87180936,... ``` ## Minimum reproducible example if you are using your own code, please provide a short script that reproduces the error. ``` import mxnet as mx from mxnet.test_utils import * def check_fully_connected(shape, num_hidden): x = mx.symbol.Variable('x') w = mx.symbol.Variable('w') test = mx.sym.FullyConnected(data=x, weight=w, num_hidden=num_hidden, no_bias=True) x_nd = mx.nd.array(random_arrays(shape)) w_nd = mx.nd.array(random_arrays((num_hidden, shape[1]))) location = {'x': x_nd, 'w': w_nd} out_dns = mx.nd.dot(x_nd, w_nd.T).asnumpy() check_numeric_gradient(test, location) check_fully_connected((32, 100), 10) ``` ## Steps to reproduce or if you are running standard examples, please provide the commands you have run that lead to the error. 1. run the above code 2. 3. ## What have you tried to solve it? 1. 2. 3. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
With regards, Apache Git Services
