-
Notifications
You must be signed in to change notification settings - Fork 137
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
Removing resizing image step #9
Comments
Hi, Could you please copy paste the error you are getting here ? Yes indeed HED doesnt fixed size image for training. Image resizing is done for faster training in this case since |
I commented these lines in data_parser.py im = im.resize((self.cfgs['training']['image_width'], self.cfgs['training']['image_height'])) And try to train I get the following error: pchaudha@costa:~/hed$ python run-hed.py --train --gpu-limit=0.7 --config-file='/home/pchaudha/hed/hed/configs/hed.yaml' For this part of your comment: " One can ofcourse train with resized images and edgemaps and test with any resolution (single image at a time)." |
You can set it to large value like 3200. This would work only if the test images are in a batch size of 1 though.
This part is due to the fact that all training image are of different sizes and cant be processed a as batch on GPU. A way around would be reduce batch size to 1 and disabling image width and height ( Disclaimer : i haven't tried it myself) |
"You can set it to large value like 3200. This would work only if the test images are in a batch size of 1 though." "This part is due to the fact that all training image are of different sizes and cant be processed a as batch on GPU. A way around would be reduce batch size to 1 and disabling image width and height ( Disclaimer : i haven't tried it myself)" Thanks a lot for the support. Really appreciate it. |
I also have the same question. Now your code give outputs of fixed size (480*320). But I want to get flexible output size. I hope the output size is the same with the input size. So, I change the some code. I change image placeholder's size into [None,None,None,3], and edgemap placeholder's size into [None,None,None,1]. Then, in test.py, I ignore the image resize line. But, I get this error. Could you give me some help? 2018-06-05 03:47:51.917737: W tensorflow/core/framework/op_kernel.cc:1152] Invalid argument: ConcatOp : Dimensions of inputs should match: shape[0] = [1,904,962,1] vs. shape[2] = [1,904,964,1] Caused by op u'concat', defined at: InvalidArgumentError (see above for traceback): ConcatOp : Dimensions of inputs should match: shape[0] = [1,904,962,1] vs. shape[2] = [1,904,964,1] |
From the HED paper I understood that we don't need to resize images as the network doesn't have any fully connected layers. So for my own dataset I wanted to change your code to remove this step so it take any size image and also produces edge map of same size as image.
But just removing these lines
im = im.resize((self.cfgs['training']['image_width'], self.cfgs['training']['image_height']))
em = em.resize((self.cfgs['training']['image_width'], self.cfgs['training']['image_height']))
is giving an error.
Is it possible to do this with your code?
Any hint or pointer would be appreciated. Thank you.
The text was updated successfully, but these errors were encountered: