{"action":"opened","issue":{"url":"https://api.github.com/repos/LisaAnne/lisa-caffe-public/issues/7","labels_url":"https://api.github.com/repos/LisaAnne/lisa-caffe-public/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/LisaAnne/lisa-caffe-public/issues/7/comments","events_url":"https://api.github.com/repos/LisaAnne/lisa-caffe-public/issues/7/events","html_url":"https://github.com/LisaAnne/lisa-caffe-public/issues/7","id":122871546,"number":7,"title":"Failing in passing the test of lstm layer and rnn layet transplant to the newest caffe","user":{"login":"hqqxyy","id":3648878,"avatar_url":"https://avatars.githubusercontent.com/u/3648878?v=3","gravatar_id":"","url":"https://api.github.com/users/hqqxyy","html_url":"https://github.com/hqqxyy","followers_url":"https://api.github.com/users/hqqxyy/followers","following_url":"https://api.github.com/users/hqqxyy/following{/other_user}","gists_url":"https://api.github.com/users/hqqxyy/gists{/gist_id}","starred_url":"https://api.github.com/users/hqqxyy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hqqxyy/subscriptions","organizations_url":"https://api.github.com/users/hqqxyy/orgs","repos_url":"https://api.github.com/users/hqqxyy/repos","events_url":"https://api.github.com/users/hqqxyy/events{/privacy}","received_events_url":"https://api.github.com/users/hqqxyy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-18T03:23:44Z","updated_at":"2015-12-18T03:23:44Z","closed_at":null,"body":"Hi,\r\n\r\nI'm trying to transplant the lstm layer and rnn layer from the lisa's branch (https://github.com/LisaAnne/lisa-caffe-public/tree/lstm_video_deploy) to the newest caffe version. Now I can compile the caffe, However, there are some error in the test of lstm and rnn forward propagation. \r\n\r\nWould me mind giving me some advice?\r\n\r\nHere are some steps that I have followed:\r\n\r\n1, change caffe.proto, \r\n\r\n    (a) Add RecurrentParameter.\r\n    (b) Add optional bool coeff_blob = 4 [default = false] to EltwiseParameter\r\n\r\n2. I copy $LISA_CAFFE_ROOT$/include/caffe/sequence_layers.hpp to $NEWEST_CAFFE_ROOT$/include/caffe/\r\n\r\n3. I copy lstm_layer.cpp lstm_unit_layer.cpp lstm_unit_layer.cu  rnn_layer.cpp eltwise_layer.cpp eltwise_layer.cu  eltwise_layer.cpp recurrent_layer.cu of  $LISA_CAFFE_ROOT$/src/caffe/layers/ to $NEWEST_CAFFE_ROOT$/src/caffe/layers/\r\n\r\n4. I copy the test_eltwise_layer.cpp test_rnn_layer.cpp test_lstm_layer.cpp of  $LISA_CAFFE_ROOT$/src/caffe/test to  $NEWEST_CAFFE_ROOT$/src/caffe/test\r\n\r\n5. In lstm_layer.hpp, I add bool coeff_blob_;\r\n\r\n6 in recurrent_layer.cpp I change the the line 192\r\n\r\nunrolled_net_->ShareWeightData() to unrolled_net_->ShareWeights()\r\n\r\nin line 136\r\n\r\nunrolled_net_->param_display_names()  to unrolled_net_->layer_names() \r\n\r\n7. I change some #inlcude in those files to find the correct header file.\r\n\r\nThen I test the our layers\r\n\r\nHowever, There are some problems in the forward process of LSTM and RNN layer, But their backward process is correct. I have attached the log file as test.log. Here are some logs (I have delete test files of other layers.)\r\n\r\n[==========] Running 100 tests from 12 test cases.\r\n[----------] Global test environment set-up.\r\n[----------] 12 tests from EltwiseLayerTest/0, where TypeParam = caffe::CPUDevice<float>\r\n[ RUN      ] EltwiseLayerTest/0.TestUnstableProdGradient\r\n[       OK ] EltwiseLayerTest/0.TestUnstableProdGradient (411 ms)\r\n[ RUN      ] EltwiseLayerTest/0.TestMax\r\n[       OK ] EltwiseLayerTest/0.TestMax (0 ms)\r\n[ RUN      ] EltwiseLayerTest/0.TestSumBlobCoeffGradient\r\n[       OK ] EltwiseLayerTest/0.TestSumBlobCoeffGradient (488 ms)\r\n[ RUN      ] EltwiseLayerTest/0.TestSumGradient\r\n[       OK ] EltwiseLayerTest/0.TestSumGradient (8 ms)\r\n[ RUN      ] EltwiseLayerTest/0.TestProd\r\n[       OK ] EltwiseLayerTest/0.TestProd (0 ms)\r\n[ RUN      ] EltwiseLayerTest/0.TestSum\r\n[       OK ] EltwiseLayerTest/0.TestSum (0 ms)\r\n[ RUN      ] EltwiseLayerTest/0.TestSumBlobCoeff\r\n[       OK ] EltwiseLayerTest/0.TestSumBlobCoeff (0 ms)\r\n[ RUN      ] EltwiseLayerTest/0.TestSetUp\r\n[       OK ] EltwiseLayerTest/0.TestSetUp (0 ms)\r\n[ RUN      ] EltwiseLayerTest/0.TestStableProdGradient\r\n[       OK ] EltwiseLayerTest/0.TestStableProdGradient (9 ms)\r\n[ RUN      ] EltwiseLayerTest/0.TestMaxGradient\r\n[       OK ] EltwiseLayerTest/0.TestMaxGradient (13 ms)\r\n[ RUN      ] EltwiseLayerTest/0.TestSumCoeff\r\n[       OK ] EltwiseLayerTest/0.TestSumCoeff (0 ms)\r\n[ RUN      ] EltwiseLayerTest/0.TestSumCoeffGradient\r\n[       OK ] EltwiseLayerTest/0.TestSumCoeffGradient (8 ms)\r\n[----------] 12 tests from EltwiseLayerTest/0 (937 ms total)\r\n\r\n\r\n..........\r\n\r\nt = 2; i = 18\r\nsrc/caffe/test/test_rnn_layer.cpp:129: Failure\r\nThe difference between this->blob_top_.cpu_data()[i] and top_copy.cpu_data()[t * top_count + i] is 0.21732622027654619, which exceeds kEpsilon, where\r\nthis->blob_top_.cpu_data()[i] evaluates to 0.17236440263258129,\r\ntop_copy.cpu_data()[t * top_count + i] evaluates to -0.044961817643964883, and\r\nkEpsilon evaluates to 1.0000000000000001e-05.\r\nt = 2; i = 19\r\nsrc/caffe/test/test_rnn_layer.cpp:129: Failure\r\nThe difference between this->blob_top_.cpu_data()[i] and top_copy.cpu_data()[t * top_count + i] is 0.21739330743050303, which exceeds kEpsilon, where\r\nthis->blob_top_.cpu_data()[i] evaluates to -0.015220307852385099,\r\ntop_copy.cpu_data()[t * top_count + i] evaluates to -0.23261361528288813, and\r\nkEpsilon evaluates to 1.0000000000000001e-05.\r\nt = 2; i = 20\r\n[  FAILED  ] RNNLayerTest/1.TestForward, where TypeParam = caffe::CPUDevice<double> (9 ms)\r\n[ RUN      ] RNNLayerTest/1.TestSetUp\r\n[       OK ] RNNLayerTest/1.TestSetUp (1 ms)\r\n[----------] 5 tests from RNNLayerTest/1 (532 ms total)\r\n\r\n[----------] Global test environment tear-down\r\n[==========] 100 tests from 12 test cases ran. (45362 ms total)\r\n[  PASSED  ] 92 tests.\r\n[  FAILED  ] 8 tests, listed below:\r\n[  FAILED  ] RNNLayerTest/0.TestForward, where TypeParam = caffe::CPUDevice<float>\r\n[  FAILED  ] RNNLayerTest/1.TestForward, where TypeParam = caffe::CPUDevice<double>\r\n[  FAILED  ] RNNLayerTest/2.TestForward, where TypeParam = caffe::GPUDevice<float>\r\n[  FAILED  ] RNNLayerTest/3.TestForward, where TypeParam = caffe::GPUDevice<double>\r\n[  FAILED  ] LSTMLayerTest/0.TestForward, where TypeParam = caffe::CPUDevice<float>\r\n[  FAILED  ] LSTMLayerTest/1.TestForward, where TypeParam = caffe::CPUDevice<double>\r\n[  FAILED  ] LSTMLayerTest/2.TestForward, where TypeParam = caffe::GPUDevice<float>\r\n[  FAILED  ] LSTMLayerTest/3.TestForward, where TypeParam = caffe::GPUDevice<double>\r\n\r\n 8 FAILED TESTS\r\n\r\n\r\n\r\nThanks a lot !\r\n"}}