Caffe: CHECK_LE(n, num()) should be CHECK_LT

Created on 4 Oct 2017  ·  11Comments  ·  Source: BVLC/caffe

https://github.com/BVLC/caffe/blob/fac74347106ea16140ace828e8d278716e4d4742/include/caffe/blob.hpp#L156

I think CHECK_LE(n, num()) should be CHECK_LT , same as CHECK_LE in the following lines of this function,
which can be in accordance with the other fuction "offset(const vector& indices)"

bug

Most helpful comment

@hkxIron you should push to your own clone. Clone BVLC Caffe (through github), then change origin to point to your Caffe and set upstream to track the upstream Caffe at BVLC:

git remote set-url origin [email protected]:hkxIron/caffe.git
git remote add upstream [email protected]:BVLC/caffe.git

Then:

git push -u origin feature_issue_5964

Then go to BVLC Caffe and click on the button to make that a PR (github knows it is cloned and suggests the easy way to PR)

All 11 comments

CHECK_LE in offset()n,c,h,w) should be replace with CHECK_LT,
when n==num(), it out of ranges actually!
which can be equal with offset(indices),

Good point.

in fact all CHECK_LE in inline int offset(const int n, const int c = 0, const int h = 0, const int w = 0) const should be converted to CHECK_LT in accordance with inline int offset(const vector<int>& indices) const.

Can you please open a pull-request fixing this issue? See Developing and Contributing how to do this.

Thank you very much,
-Shai

when I run the command " git push origin feature_issue_5964"
I get the following error:
remote: Permission to BVLC/caffe.git denied to hkxIron.
fatal: unable to access 'https://github.com/BVLC/caffe.git/': The requested URL returned error: 403

@hkxIron you should push to your own clone. Clone BVLC Caffe (through github), then change origin to point to your Caffe and set upstream to track the upstream Caffe at BVLC:

git remote set-url origin [email protected]:hkxIron/caffe.git
git remote add upstream [email protected]:BVLC/caffe.git

Then:

git push -u origin feature_issue_5964

Then go to BVLC Caffe and click on the button to make that a PR (github knows it is cloned and suggests the easy way to PR)

@dashesy , But what the question is that i have fork the repository "[email protected]:hkxIron/caffe.git" before , and I had made some my own modifies to my repository "[email protected]:hkxIron/caffe.git". I'm afraid my own modifies will be in the PR . Thanks

@hkxIron it's great that you have your own fork! you only need to have a different branch.
This new branch should contain only the changes relevant to this fix, and non of your other changes.
See "Shelhamer’s “life of a branch in four acts”" in here.

@shaibagon , what I mean is that I had made some my own modifies to my own repository "[email protected]:hkxIron/caffe.git" before I found this bug issue , it means that i had modified my master branch before . Does it means i shoud bakup my master branch then roll back my master to original then create new branch feature_issue_5964? Thanks.

@hkxIron I suppose you can create a new branch bvlc_master and make it identical to upstream master then branch from there and create the feature branch.

I will try . Thanks.

@hkxIron Once you have a PR we may close this issue and move the discussion to the PR.

encouraging any further discussion of this issue to be in #6021

Was this page helpful?
0 / 5 - 0 ratings

Related issues

OpenHero picture OpenHero  ·  3Comments

weather319 picture weather319  ·  3Comments

vladislavdonchev picture vladislavdonchev  ·  3Comments

prathmeshrmadhu picture prathmeshrmadhu  ·  3Comments

erogol picture erogol  ·  3Comments