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

Testing 3D trained model using Python Script & Deploy file #163

Closed
omair18 opened this issue Nov 5, 2016 · 12 comments
Closed

Testing 3D trained model using Python Script & Deploy file #163

omair18 opened this issue Nov 5, 2016 · 12 comments

Comments

@omair18
Copy link
Contributor

omair18 commented Nov 5, 2016

I was successful in training my 3D dataset by giving 5D tensor ( 10x1x32x32x32) to the network. Now I'm using python script to load the trained model and deploy.prototxt and giving the input test dataset in the form of 5D tensor ( 10x1x32x32x32) but caffe outputs a ValueError saying "could not broadcast input array from shape (10,1,32,32,32) into shape (10,1,32,32).
Isn't it the right way to do? why my model is expecting a 10,1,32,32 shape?
image

@dutran
Copy link
Contributor

dutran commented Nov 6, 2016

need to modify HDF5data_output as well, please wait for another minor commit.

@dutran
Copy link
Contributor

dutran commented Nov 6, 2016

@omair18 please try again.

@omair18
Copy link
Contributor Author

omair18 commented Nov 6, 2016

@dutran I can't see any change in the output, getting the very same error.
I have pulled the update and did make all, make pycaffe.
Secondly, I'm using caffe.Classifier( deploy, trainedfile) in my python script. Any suggestions?

@dutran
Copy link
Contributor

dutran commented Nov 6, 2016

Try this instead #59.

@omair18
Copy link
Contributor Author

omair18 commented Nov 6, 2016

I'm slightly confused with the usage of above mentioned script for my specific case. Can you please guide me how to test a single 3D object? Object dimensions are 32x32x32 ( length x width x height) and i'm making a 5D tensor with dimensions batchsize x channels x length x width x height.

@dutran
Copy link
Contributor

dutran commented Nov 6, 2016

Is you problem is just simply classification? If so, you don't need to use python wrapper. Just use test_net to test (for final accuracy). If you prefer to use some intermediate output, use extract_image_features to extract them and further process them if needed.

@omair18
Copy link
Contributor Author

omair18 commented Nov 6, 2016

My problem is somewhat related to scene classification. I want to crop a 3D piece from a scene and classify it with the help of my trained network. test_net won't help me in this case i guess.

@omair18
Copy link
Contributor Author

omair18 commented Nov 8, 2016

@dutran I'm trying to look into this python wrapper ( pycaffe.py). If you get any success, do let me know please.

@omair18
Copy link
Contributor Author

omair18 commented Nov 9, 2016

@dutran It seems like, changing Class CaffeBlobWrap in caffe.cpp solved the issue. I increased the dimensions in object_get_data() function from 4 to 5 and the ValueError is gone.
Also there was a check in pycaffe.py _Net_forward() function, I changed it from 4 to 5.

@dutran
Copy link
Contributor

dutran commented Nov 9, 2016

@omair18 can you send in a PR? Thanks

@dutran
Copy link
Contributor

dutran commented Nov 9, 2016

Glad to hear it works for you.

@dutran dutran closed this as completed Nov 9, 2016
@omair18
Copy link
Contributor Author

omair18 commented Nov 11, 2016

@dutran I'm rather new on github and unable to figure out how to send my modified project in a PR. Can you guide me a bit?
I've forked this project on my profile and committing changes into it.

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