-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nd Pooling #2442
base: master
Are you sure you want to change the base?
Nd Pooling #2442
Conversation
Looks like the ND code had an indexing issue. The blob indexes that failed the gradient tests were all edge (lower edges). I believe that it must be an issue with the forward pass. |
This doesn't touch any cudnn code. It only applies to the CAFFE engine. |
I have solved my compile error. Thanks for this sharing! I'm wonder to know is it possible to build nd-pooling based on cudnn v2? Because cudnn v2 have the cudnnndpooling and cudnnndconvolution API for N>=3. |
stride_h_ = pool_param.stride_h(); | ||
stride_w_ = pool_param.stride_w(); | ||
for (int i = 0; i < num_spatial_axes_; ++i) { | ||
CHECK_GT(kernel_shape_data[i], 0) << "Filter dimensions must be nonzero."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check failed in lrnlayertest, test case :LRNLayerTest, testsetupwithinchannel
Hello, |
just send a PR and add notes in detail. Then give a ref here |
Hello, your work is awesome, but I'm kind of confused about how to use it and how to write a prototxt of 'Nd caffe'. Can you send me some examples?My email address is liyang951102@gmail.com.Thanks a lot~ |
Is Channel an axes? I loaded my data in HDF5 format(Size: 28x28x28x1x200),but returned error ‘>4 axes’?What should I do? |
@YOUNGING I think you had a mistake. Because I checked that this branch is right. use https://github.com/jmerkow/caffe/tree/nd-pooling-public and set path to /caffe-nd-pooling-public/build/tools on ~/.bashrc. I use this solver and model and generating_3D_data using hdf5 format. but I am confusing how to use the networks values which are blobs. Because 3D data can't use matcaffe interface for testing that networks is right, and using results. Does anyone have some idea for this? |
I do everything in Python. Pycaffe interface works fine for blobs. |
@shelhamer Sure. I'll get to work on this in the next few days. |
Hi all, any news about this NDpooling contribution ? |
What's the perf impact (on CPU and GPU) for fprop/bprop on |
@jmerkow, I tried this promotion and ND-Convolution & Pooling worked fine but there is one thing I concerned about that this promotion's python/draw_net.py somehow did not work. It caused below error. I compiled other caffe promotion on the same machine and their python/draw_net.py worked fine. Error message: python/draw_net.py ./examples/siamese/mnist_siamese.prototxt ./examples/siamese/mnist_siamese.png |
Yes, you need it modify the code that generates the strings for drawnet. They used to be single values, now they are lists. |
@jmerkow Thanks for your answer, I have successfully trained ND-conv and ND-pooling with my HDF5 datasets based on CaffeNet Model layers without Local response normalization (LRN) layer in this promotion. Is it possible to ND-LRN? Or, isn't it necessary for me to add ND-LRN? |
This PR only provides ND pooling support. |
Thanks for your quick response! |
@jmerkow I have been training my network model with my 3D data 32x32x32 with CaffeNet layer but I almost always got high loss values below. I tweaked around my solver parameters to get better results but I have not gotten yet. My training data is about 1842 for training and 201 for testing. Train net output #0: loss = 87.3365 (* 1 = 87.3365 loss) I assumed you do the training with your python scripts. I am simply executing caffe train command to train my network. Should I use python interface for my training? Well, I write caffe training script in python like below but I think it is the same. #!/usr/bin/env python solver = caffe.SGDSolver("CAD-Train-48/3DCNN-solver-MNIST-Conv2-Pool2.prototxt") The training data is one thing but my data look working with 3D training so I assumed that I have to do something with my loss or accuracy calculations. Do I have to write a python script to run solver like an example "01-learning-lenet.ipynb" in examples folder? |
@jmerkow I have a question about classification. I could not load deploy start data like below. input: "data" This is because it caused the error below so I simply took train dataset layer and leave test dataset in train-val.prototxt and load it as deploy file and load pretrained model to classify data. This seems to be working. Is this correct way to classify input data? "check failed: param.input_size() * 4 == param.input_dim_size() (4 vs. 5) Incorrect input blob dimension specifications." |
I don't think PoolingLayer::Reshape is correct. It does not update the new shape using bottom and so doesn't actually reshape. I would add these lines:
Edit: This fixes failures in NetTest*TestReshape |
Has this PR been abandoned? |
I can take another look at this. Besides rebase, what does it need? (Tests etc) |
@jmerkow good to hear! @jmerkow good to hear! Once rebased, I'd look at the N-D convolution tests to have a sense of the expected coverage. There could be slight documentation updates needed in the layer header and layer catalogue too. If you still have any questions about testing or the gradient checker, please ask here. Thanks. |
Any news about status of this PR? Thanks. |
Hi @jmerkow, @shelhamer, I want to test Nd-pooling for my problem. However, it seems that the repo has been abandoned. I could not find |
Depends on #2049 'ND convolution with im2col'. I'll rebase once that is finalized and merged.
Some of the GPU (gradient and stochastic) tests fail on occasion. Im not sure what the issue is. I've checked the layer output vs master, and the computed values are the same. However the estimated gradients seem to be off... The estimated_gradient values are nan a lot, where as the computed_gradient is reasonable, so I might setting the test up incorrectly. I didn't look too closely at GradientChecker. I am hoping for comments on this.
No issues with CPU Mode. CPU only goes to 3D though. ND,N=2 or 3 computation is much slower than 2D/3D with nested loops. Similar code to GPU loops can be added for num_spatial_axes > 3, but I wanted to wait before I added it since there are issues.