nn-transfer icon indicating copy to clipboard operation
nn-transfer copied to clipboard

Error in nn_transfer.test.test_layers.TestLayers

Open bhaskar-manguluri opened this issue 6 years ago • 0 comments

Install torch,torchvision,tensorflow in virtualenv. with python setup.py test I get below error

ERROR: test_batch_normalization (nn_transfer.test.test_layers.TestLayers)

Traceback (most recent call last): File "/Users//nn-transfer/nn_transfer/test/test_layers.py", line 87, in test_batch_normalization keras_model, pytorch_model, self.test_data, 1e-3) File "/Users//nn-transfer/nn_transfer/test/helpers.py", line 36, in assertEqualPrediction pytorch_prediction = pytorch_model(test_data_tensor).data.numpy() File "/Users//nn-transfer/env2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 491, in call result = self.forward(input, ********kwargs) File "/Users//nn-transfer/nn_transfer/test/test_layers.py", line 22, in forward return self.bn(x) File "/Users//nn-transfer/env2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 491, in call result = self.forward(input, ********kwargs) File "/Users//nn-transfer/env2/lib/python2.7/site-packages/torch/nn/modules/batchnorm.py", line 45, in forward self._check_input_dim(input) File "/Users/****/nn-transfer/env2/lib/python2.7/site-packages/torch/nn/modules/batchnorm.py", line 264, in _check_input_dim .format(input.dim())) ValueError: expected 5D input (got 4D input) -------------------- >> begin captured logging << -------------------- tensorflow: Level 1: Created variable bn_1/moving_mean/biased:0 with shape and init Tensor("bn_1/AssignMovingAvg/bn_1/moving_mean/zeros:0", shape=(3,), dtype=float32) tensorflow: Level 1: Created variable bn_1/moving_mean/local_step:0 with shape () and init <tensorflow.python.ops.init_ops.Zeros object at 0x11aa93c50> tensorflow: Level 1: Created variable bn_1/moving_variance/biased:0 with shape and init Tensor("bn_1/AssignMovingAvg_1/bn_1/moving_variance/zeros:0", shape=(3,), dtype=float32) tensorflow: Level 1: Created variable bn_1/moving_variance/local_step:0 with shape () and init <tensorflow.python.ops.init_ops.Zeros object at 0x11ca8ded0> --------------------- >> end captured logging << ---------------------

bhaskar-manguluri avatar May 14 '18 10:05 bhaskar-manguluri