Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Data blob's shape incompatible with training's data shape during testing. #164

Closed
omair18 opened this issue Nov 7, 2016 · 4 comments
Closed

Comments

@omair18
Copy link
Contributor

omair18 commented Nov 7, 2016

I trained my model using data shape = 10x1x32x32x32 in a hdf5 file (see 1st screenshot). But when I load my trained model in python using caffe.Net() and a deploy.prototxt file (screenshot 2) mentioning input_dim my data blob's shape returned is 10x1x32x32 which is a 4D vector whereas data loaded at the time of training was a 5D vector.
Why is there such difference? How can I correct this problem?

selection_007
selection_009
selection_008

@dutran
Copy link
Contributor

dutran commented Nov 8, 2016

First question: in training, you have input
[data] = 10x1x32x32x32 I read as mini-batch =10 examples, channel=1, volume size = 32x32x32
[label] = 10x1x32x1x1 so that mean each label has size 1x32x1x1 what is that?

Could you point me to the python script you used? Is it #59, we haven't fully tested that PR yet. So potentially there are some dimension mismatch

@omair18
Copy link
Contributor Author

omair18 commented Nov 8, 2016

There was a slight mistake in hdf5_data_layer.cpp. Lable's blob was mistakenly reshaped to data blobs length size. I have resolved this error and now label shape is 10x1x1x1x1.
I am simply loading Deploy.prototxt and trained model in caffe.Classifier() and trying to input data using net.forward(data= inputdata) function.
selection_075
selection_074

@omair18
Copy link
Contributor Author

omair18 commented Nov 8, 2016

@dutran still having the same issue ( regarding data blob size ) even after correcting label's dimensions while training. Any suggestion please?

@dutran
Copy link
Contributor

dutran commented Nov 8, 2016

I think this issue caused by the python wrapper #163. So closing this and follow-up on the other issue.

@dutran dutran closed this as completed Nov 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants