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

Non square images representation #133

Open
ivandirtech opened this issue Nov 19, 2017 · 8 comments
Open

Non square images representation #133

ivandirtech opened this issue Nov 19, 2017 · 8 comments

Comments

@ivandirtech
Copy link

Hi,
Input blob in my deploy prototxt has 224x288 dimensions (bvlc-googlenet).
2 things are bothering me:

  1. By default the image is resized to a square one -> 224x224 and it influences the classification results of the network. After hitting '0' to cancel reshaping, things work properly.
  2. Even after I disable input image reshaping, in GUI it is still shown as a square -> crop happens.
    Is there any way the GUI can be fixed to show the whole image and not the cropped one?
@arikpoz
Copy link
Contributor

arikpoz commented Nov 19, 2017

@ivandirtech

I've substantially refactored the tool, fixed many bugs, among them the tool ability to work on rectangular inputs instead of squares

Latest version is in https://github.com/arikpoz/deep-visualization-toolbox

@ivandirtech
Copy link
Author

@arikpoz I glad you answered, because I am already using your improved version (thx for the great job BTW!) so the issue still happens.

@arikpoz
Copy link
Contributor

arikpoz commented Nov 19, 2017

I recall working with non rectangular without issues, other than the ones I've fixed

@FredaZhang338
Copy link

@arikpoz Thanks for your sharing. And I have a question that when I am trying to visualize the VGG16 trained on the Faster R-CNN, I modified the mean.npy, prototxt,labels.txt and weights( I did not rename these files, I put them in the demo's folder and keep these the same name with the demo) And then I got the error like this:
got module <module 'caffevis.app' from '/home/manning/mn/deep-visualization-toolbox/caffevis/app.pyc'> got app <class 'caffevis.app.CaffeVisApp'> Got settings <module 'settings' from '/home/manning/mn/deep-visualization-toolbox/settings.pyc'> Loaded caffe in GPU mode, using device 0 [libprotobuf ERROR google/protobuf/text_format.cc:274] Error parsing text-format caffe.NetParameter: 471:24: Message type "caffe.LayerParameter" has no field named "smooth_l1_loss_param". E1228 20:01:20.436556 22212 upgrade_net_proto_text.cpp:30] Failed to parse input text file as NetParameter: /home/manning/mn/deep-visualization-toolbox/./models/caffenet-yos/caffenet-yos-deploy.prototxt.processed_by_deepvis Traceback (most recent call last): File "./run_toolbox.py", line 34, in <module> main() File "./run_toolbox.py", line 24, in main lv = LiveVis(settings) File "/home/manning/mn/deep-visualization-toolbox/live_vis.py", line 61, in __init__ app = app_class(settings, self.bindings) File "/home/manning/mn/deep-visualization-toolbox/caffevis/app.py", line 48, in __init__ self.net, self._data_mean = load_network(settings) File "/home/manning/mn/deep-visualization-toolbox/settings_misc.py", line 120, in load_network deduce_calculated_settings_without_network(settings) File "/home/manning/mn/deep-visualization-toolbox/settings_misc.py", line 15, in deduce_calculated_settings_without_network read_network_dag(settings) File "/home/manning/mn/deep-visualization-toolbox/settings_misc.py", line 207, in read_network_dag text_format.Merge(str(proto_file.read()), network_def) File "/usr/local/lib/python2.7/dist-packages/google/protobuf/text_format.py", line 265, in Merge return MergeLines(text.split('\n'), message) File "/usr/local/lib/python2.7/dist-packages/google/protobuf/text_format.py", line 298, in MergeLines _ParseOrMerge(lines, message, True) File "/usr/local/lib/python2.7/dist-packages/google/protobuf/text_format.py", line 229, in _ParseOrMerge _MergeField(tokenizer, message, allow_multiple_scalars) File "/usr/local/lib/python2.7/dist-packages/google/protobuf/text_format.py", line 382, in _MergeField _MergeField(tokenizer, sub_message, allow_multiple_scalars) File "/usr/local/lib/python2.7/dist-packages/google/protobuf/text_format.py", line 356, in _MergeField message_descriptor.full_name, name)) google.protobuf.text_format.ParseError: 471:3 : Message type "caffe.LayerParameter" has no field named "smooth_l1_loss_param".
The smooth_l1_loss_param is part of the train.prototxt of my own data, I do not know how to fix this problem , could you please give me some instructions? thanks for your help.

@arikpoz
Copy link
Contributor

arikpoz commented Dec 28, 2017

Are you using a custom caffe version? Was your model trained with custom caffe?

@FredaZhang338
Copy link

@arikpoz My model was not trained here, and the caffe was not installed by me, I am not sure the version.
So you mean the problem was caused by the caffe version? Is there any way I can fix the problem?
Thanks ~

@FredaZhang338
Copy link

@arikpoz I learned that the Faster-RCNN requires its own branch of caffe. This branch includes roi_pooling_layer and its associated parameters.
When I was training a model just followed the installation instructions of Faster RCNN to get the correct branch of caffe.
So if I want to visualize the VGG16 trained on the Faster R-CNN, that is I need to add this additional layers and associated parameters? Could you please give me some ideas?
Thanks for your help!

@arikpoz
Copy link
Contributor

arikpoz commented Dec 29, 2017

Either add the changes from your custom caffe to the caffe DeepVis tool uses, or if possible, retrain your faster-rcnn using latest caffe from master, if it contains the relevant roi-pooling layer

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

3 participants