Skip to content
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

Remove some unnecessary codes in classification.cpp #6478

Closed
5 tasks
GarryLau opened this issue Jul 22, 2018 · 1 comment
Closed
5 tasks

Remove some unnecessary codes in classification.cpp #6478

GarryLau opened this issue Jul 22, 2018 · 1 comment

Comments

@GarryLau
Copy link

GarryLau commented Jul 22, 2018

Important - read before submitting

Please read the guidelines for contributing before submitting this issue!

Please do not post installation, build, usage, or modeling questions, or other requests for help to Issues.
Use the caffe-users list instead.
This helps developers maintain a clear, uncluttered, and efficient view of the state of Caffe.

Issue summary

In the file: "caffe\examples\cpp_classification\classification.cpp" there are some unnecessary codes.
Codes between L151 and L155 are unnecessary:

  Blob<float>* input_layer = net_->input_blobs()[0];
  input_layer->Reshape(1, num_channels_,
                       input_geometry_.height, input_geometry_.width);
  /* Forward dimension change to all layers. */
  net_->Reshape();

Steps to reproduce

Comment the codes will be OK, you can also get the right results.

Tried solutions

Comment the codes between L151 and L155.

System configuration

Actually, it does not matter with System configuration.

  • Operating system: Ubuntu 16.04
  • Compiler: GCC\G++
  • CUDA version (if applicable): 9.0
  • CUDNN version (if applicable): 7.0
  • BLAS: OpenBlas
  • Python version (if using pycaffe): 2.7
  • MATLAB version (if using matcaffe): no

Issue checklist

  • read the guidelines and removed the first paragraph
  • written a short summary and detailed steps to reproduce
  • explained how solutions to related problems failed (tick if found none)
  • filled system configuration
  • attached relevant logs/config files (tick if not applicable)
@Noiredd
Copy link
Member

Noiredd commented Aug 16, 2018

Thank you for your interest. Please note that this is but a simple example, mostly for educational purposes rather than high-performance inference. Maybe those lines could be removed, or maybe they would be but only in your case - I don't know that off the top of my head. But I think they should stay, if only as a good practice example (you should check whether the image you want to classify fits in your network).

I will close this issue for now. If you feel like this deserves more attention - please open a PR and start a discussion there.

@Noiredd Noiredd closed this as completed Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants