-
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
Blobs are N-D arrays (for N not necessarily equals 4) #1486
Conversation
Has anyone analyzed how this will cross-impact all others PRs (some of this are ageing in the queue)? |
It should have little to no impact technically; everything works fine with just my first commit (and no changes whatsoever to existing layers). It's possible as a result of this PR we might ask for some minimal changes to not assume the 4D dimensions before we merge them into the official repo, but they will work fine without these changes. |
1a86e76
to
dfb4f23
Compare
I took a really rushed pass of the first commit, it looks pretty good. I'm glad we can do this so quickly and fairly noninvasively! |
Thanks for the feedback @longjon! |
Upd. Already done. |
@sirotenko yeah, that is why @jeffdonahue kept those properties for shorthand: jeffdonahue@3715eab#diff-5c854864685133b02ed80f33ba8ad535R73 |
4d982cd
to
a76912b
Compare
Hey Jeff, this looks sweet! I'm pulling this for review on my flight along
|
a76912b
to
3bd2c0c
Compare
Hello ,
AdaGradSolverTest/2.TestAdaGradLeastSquaresUpdateWithWeightDecay If any person have explication, ??????????????? THX, |
Any documentation of how to use the tensor-blob ??? |
73e15bc
to
12e8c11
Compare
Caffe can read 3 formats (as far as I know):
The easiest way is to store the image somewhere as a JPG (maybe another image format) and then creating two text files (trainingset.txt, testset.txt) in the following format: PATH_TO_RGB_IMAGE PATH_TO_Gray_IMAGE LABEL where LABEL is a number. For me only a relative path from the solver-file to the image file works in PATH_TO_IMAGE. I try to use the tool (in the tool directory) convert_imageset to create a leveldb or a lmdb. These db files don't support N-D blob that you have to write into your net-layout-file. THX; |
6d76bf9
to
4a8465a
Compare
num/channnels/height/width indexing is valid.
from saved NetParameter Want to keep the param Blob shape the layer has set, and not necessarily adopt the one from the saved net (e.g. want to keep new 1D bias shape, rather than take the (1 x 1 x 1 x D) shape from a legacy net).
1500fd2
to
a8023e2
Compare
@jeffdonahue @longjon how to make convolution based on N-D array in .more than 4 axes? |
This PR gives Blobs a
vector<int>
of dimensions, rather than the oldnum, channels, height, width
. The first commit is all the changes needed to get Caffe to compile and everything to run as before with the new vector of tensor dimensions. The remaining commits generalize some existing classes to use the new tensor dimensions (but they are not necessary to make it run, as it's still fine to just use all 4-D blobs with extra singleton dimensions where needed).Currently I think the only problem is that in theInnerProductLayer
the weight blobs won't be compatible with existing saved nets (since the weights are now 2D tensors and biases are 1D tensors), so I need to add something to handle that case for backwards compatibility.