Giter Club home page Giter Club logo

Comments (6)

ajtulloch avatar ajtulloch commented on June 29, 2024 1

Sorry for the delay folks. If this is the problem I'm thinking of I fixed this internally a while ago, but didn't get around to pushing out the OSS version. Sorry about that.

I think a8bba86 should fix the issue, LMK if it doesn't. Thanks.

from fb-caffe-exts.

dkislyuk avatar dkislyuk commented on June 29, 2024

@andreistoian: I had the same issue, somewhat hackishly in my Caffe installation I had to remove the check altogether (from src/caffe/layers/split_layer.cpp)

-    CHECK_NE(top[i], bottom[0]) << this->type() << " Layer does not "
-        "allow in-place computation.";

to get the optimizer to work with custom VGG-derived architectures. I did not see any adverse affects from this in evaluation / performance.

from fb-caffe-exts.

wangxianliang avatar wangxianliang commented on June 29, 2024

The bug still exists, for GoogLeNet. The error messages are as follows:
// Do not allow in-place computation in the SplitLayer. Instead, share data
// by reference in the forward pass, and keep separate diff allocations in
// the backward pass. (Technically, it should be possible to share the diff
// blob of the first split output with the input, but this seems to cause
// some strange effects in practice...)
CHECK_NE(top[i], bottom[0]) << this->type() << " Layer does not "
"allow in-place computation.";

from fb-caffe-exts.

dkislyuk avatar dkislyuk commented on June 29, 2024

@wangxianliang does removing the check and re-compiling Caffe work?

from fb-caffe-exts.

ajtulloch avatar ajtulloch commented on June 29, 2024

Yeah, move the CHECK to Backward_cpu pass.

--- a/caffe/caffe-trunk/src/caffe/layers/split_layer.cpp
+++ b/caffe/caffe-trunk/src/caffe/layers/split_layer.cpp
@@ -16,8 +16,6 @@
     // the backward pass.  (Technically, it should be possible to share the diff
     // blob of the first split output with the input, but this seems to cause
     // some strange effects in practice...)
-    CHECK_NE(top[i], bottom[0]) << this->type() << " Layer does not "
-        "allow in-place computation.";
     top[i]->ReshapeLike(*bottom[0]);
     CHECK_EQ(count_, top[i]->count());
   }
@@ -36,13 +34,17 @@
       const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom) {
   if (!propagate_down[0]) { return; }
   if (top.size() == 1) {
+    CHECK_NE(top[0], bottom[0]) << this->type() << " Layer does not "
+        "allow in-place computation.";
     caffe_copy(count_, top[0]->cpu_diff(), bottom[0]->mutable_cpu_diff());
     return;
   }
   caffe_add(count_, top[0]->cpu_diff(), top[1]->cpu_diff(),
             bottom[0]->mutable_cpu_diff());
   // Add remaining top blob diffs.
   for (int i = 2; i < top.size(); ++i) {
+    CHECK_NE(top[i], bottom[0]) << this->type() << " Layer does not "
+        "allow in-place computation.";
     const Dtype* top_diff = top[i]->cpu_diff();
     Dtype* bottom_diff = bottom[0]->mutable_cpu_diff();
     caffe_axpy(count_, Dtype(1.), top_diff, bottom_diff);

from fb-caffe-exts.

wangxianliang avatar wangxianliang commented on June 29, 2024

Removing the check does work, thanks a lot.

from fb-caffe-exts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.