[bug report] Floating point exception when width and/or height equals crop_size
In
src/caffe/data_transformer.cpp
replace
h_off = Rand() % (height - crop_size);
w_off = Rand() % (width - crop_size);
with
h_off = height > crop_size ? Rand() % (height - crop_size) : 0;
w_off = width > crop_size ? Rand() % (width - crop_size) : 0;
Can you prepare a PULL REQUEST?
Is this the same bug fixed in dev by #1149 but still in master?
I think that this want also to assert that crop_size in not > of width and height.
@shelhamer right, this is fixed by #1149. @mlapin, you should be able to use the fix by merging with master or whatever branch you are on. Note that the original code is wrong, and the proposed solution is also wrong.
@shelhamer should we merge the fix also to master? I didn't bother since it seemed like an uncommon thing, but maybe this codepath gets hit more often with the data transformer refactoring...
Yeah, we should likely cherry-pick the fix. It'll cause a conflict in the next release merge but oh well.
It's not yet second-nature to merge fixes to master instead, so I've fallen into the same trap with a few recent fixes in dev.
On Wednesday, October 1, 2014, longjon [email protected] wrote:
@shelhamer https://github.com/shelhamer right, this is fixed by #1149 https://github.com/BVLC/caffe/pull/1149. @mlapin https://github.com/mlapin, you should be able to use the fix by merging with master or whatever branch you are on. Note that the original code is wrong, and the proposed solution is also wrong.
@shelhamer https://github.com/shelhamer should we merge this fix also to master? I didn't bother since it seemed like an uncommon thing, but maybe this codepath gets hit more often with the data transformer refactoring...
— Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/1199#issuecomment-57505156.
If it's a clean merge to master, can we not simply merge to master as well?
On Wed, Oct 1, 2014 at 11:13 AM, Evan Shelhamer [email protected] wrote:
Yeah, we should likely cherry-pick the fix. It'll cause a conflict in the next release merge but oh well.
It's not yet second-nature to merge fixes to master instead, so I've fallen into the same trap with a few recent fixes in dev.
On Wednesday, October 1, 2014, longjon [email protected] wrote:
@shelhamer https://github.com/shelhamer right, this is fixed by #1149 https://github.com/BVLC/caffe/pull/1149. @mlapin https://github.com/mlapin, you should be able to use the fix by merging with master or whatever branch you are on. Note that the original code is wrong, and the proposed solution is also wrong.
@shelhamer https://github.com/shelhamer should we merge this fix also to master? I didn't bother since it seemed like an uncommon thing, but maybe this codepath gets hit more often with the data transformer refactoring...
— Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/1199#issuecomment-57505156.
— Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/1199#issuecomment-57510060.
The PR was made to dev so you would have to rebase on master or cherry-pick. If you merge the branch directly it will pull all of dev at the time of the PR into master along with it.
You can selectively merge from the past to the future, but not from the future to the past.
On Wed, Oct 1, 2014 at 11:19 AM, longjon [email protected] wrote:
If it's a clean merge to master, can we not simply merge to master as well?
On Wed, Oct 1, 2014 at 11:13 AM, Evan Shelhamer [email protected]
wrote:
Yeah, we should likely cherry-pick the fix. It'll cause a conflict in the next release merge but oh well.
It's not yet second-nature to merge fixes to master instead, so I've fallen into the same trap with a few recent fixes in dev.
On Wednesday, October 1, 2014, longjon [email protected] wrote:
@shelhamer https://github.com/shelhamer right, this is fixed by #1149 https://github.com/BVLC/caffe/pull/1149. @mlapin https://github.com/mlapin, you should be able to use the fix by merging with master or whatever branch you are on. Note that the original code is wrong, and the proposed solution is also wrong.
@shelhamer https://github.com/shelhamer should we merge this fix also to master? I didn't bother since it seemed like an uncommon thing, but maybe this codepath gets hit more often with the data transformer refactoring...
— Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/1199#issuecomment-57505156.
— Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/1199#issuecomment-57510060.
— Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/1199#issuecomment-57510953.
Ah, of course, I keep forgetting about that.
On Wed, Oct 1, 2014 at 11:38 AM, Evan Shelhamer [email protected] wrote:
The PR was made to dev so you would have to rebase on master or cherry-pick. If you merge the branch directly it will pull all of dev at the time of the PR into master along with it.
You can selectively merge from the past to the future, but not from the future to the past.
On Wed, Oct 1, 2014 at 11:19 AM, longjon [email protected] wrote:
If it's a clean merge to master, can we not simply merge to master as well?
On Wed, Oct 1, 2014 at 11:13 AM, Evan Shelhamer < [email protected]>
wrote:
Yeah, we should likely cherry-pick the fix. It'll cause a conflict in the next release merge but oh well.
It's not yet second-nature to merge fixes to master instead, so I've fallen into the same trap with a few recent fixes in dev.
On Wednesday, October 1, 2014, longjon [email protected] wrote:
@shelhamer https://github.com/shelhamer right, this is fixed by #1149 https://github.com/BVLC/caffe/pull/1149. @mlapin https://github.com/mlapin, you should be able to use the fix by merging with master or whatever branch you are on. Note that the original code is wrong, and the proposed solution is also wrong.
@shelhamer https://github.com/shelhamer should we merge this fix also to master? I didn't bother since it seemed like an uncommon thing, but maybe this codepath gets hit more often with the data transformer refactoring...
— Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/1199#issuecomment-57505156.
— Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/1199#issuecomment-57510060.
— Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/1199#issuecomment-57510953.
— Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/1199#issuecomment-57513962.
Already fixed.