GithubHelp home page GithubHelp logo

Comments (7)

isht7 avatar isht7 commented on June 7, 2024

Thank you for your report. I have fixed the possible cause of this error. Please pull this file and run again. If you encounter an error, please report. Also, dont forget to use the --NoLabels flag.
As a separate note, you cannot use 2 labels as 0 and 255. Your labels must be contiguous, that is 0,1 if you have only 2 labels(otherwise I expect an error when you train using train.py, as the loss function expects labels to be contiguous). Be aware that in evalpyt2.py, label 255 is merged with 0 (see here) because originally in VOC, 255 label is labeled as background. You may want to remove that line.

from pytorch-deeplab-resnet.

isht7 avatar isht7 commented on June 7, 2024

Update: I have removed the line which merges label 0 with 255 just now from evalpyt2.py as this was not done by authors of the deeplab paper originally.

from pytorch-deeplab-resnet.

sequae92 avatar sequae92 commented on June 7, 2024

Thank you for such a prompt response. I was able to bypass that error after incorporating your changes.

I have a few more clarifications with regard to the same:

  1. I was able to train with image labels , 0 and 255, and did not come across any error. Is there any explicit condition which constrains training to continuous labels only ? Also if yes, how can that be bypassed?
    In my use case, I am provided groundtruth with image labels as binary only [0 and 255 in this case]

  2. Also I wanted to clarify what is the rationale behind converting the images into (513,513,3) in the evalpyt2.py. Any such conversion is not done while training on the dataset.

I am facing this error now
img[:img_temp.shape[0],:img_temp.shape[1],:] = img_temp
ValueError: could not broadcast input array from shape (1680,1224,3) into shape (513,513,3)

Thanks for your time.

from pytorch-deeplab-resnet.

sequae92 avatar sequae92 commented on June 7, 2024

Update: Nevermind the 2nd question, I have rectified it on my side.

I receive this error now: Not much documentation online on how to resolve this:
{'--NoLabels': '2',
'--gpu0': '0',
'--help': False,
'--snapPrefix': 'VOC12_scenes_',
'--testGTpath': '/mnt/VTSRAID01/SAMI_EXPERIMENTS/Segmentation/DataForAnalytics/GIS_ALL_IMAGES/TestImageGroundtruth/',
'--testIMpath': '/mnt/VTSRAID01/SAMI_EXPERIMENTS/Segmentation/DataForAnalytics/GIS_ALL_IMAGES/TestImage/',
'--visualize': True}
VOC12_scenes_
Traceback (most recent call last):
File "evalpyt2.py", line 106, in
output = model(Variable(torch.from_numpy(img[np.newaxis, :].transpose(0,3,1,2)).float(),volatile = True).cuda(gpu0))
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 206, in call
result = self.forward(*input, **kwargs)
File "/home/spondon/testbed/segmentation/pytorch-deeplab-resnet/deeplab_resnet.py", line 204, in forward
temp1 = torch.max(out[0],x2Out_interp)
File "/usr/local/lib/python2.7/dist-packages/torch/autograd/variable.py", line 447, in max
return Cmax()(self, dim)
File "/usr/local/lib/python2.7/dist-packages/torch/autograd/_functions/pointwise.py", line 215, in forward
self._max_buffer = a.gt(b).type_as(a)
RuntimeError: sizes do not match at /b/wheel/pytorch-src/torch/lib/THC/generated/../THCTensorMathCompareT.cuh:65

from pytorch-deeplab-resnet.

isht7 avatar isht7 commented on June 7, 2024

Two points.

  1. You did not encounter an error because, during train time 255 is merged with 0.[see here]. I recommend that you change your labels from 255 to 1, and then train again. Now you are just training on images with labels fully 0. Because 255 is merged with 0, only 0 remains.
  2. As for the error you are getting, can you verify and tell what is the size of img just before it is passed into line 106? A square image must be passed to the model. Failure to do so would result in this error.
    Can you tell me what print img.shape outputs just before the line which produces this error?

from pytorch-deeplab-resnet.

isht7 avatar isht7 commented on June 7, 2024

Also I wanted to clarify what is the rationale behind converting the images into (513,513,3) in the evalpyt2.py. Any such conversion is not done while training on the dataset.

This has been done by deeplab-resnet caffe during test time(have a look at their data layer in test.prototxt), and therefore we also did it. Because only square images can be sent, we pad the image so that the size becomes (513,513,3).

from pytorch-deeplab-resnet.

isht7 avatar isht7 commented on June 7, 2024

If there are any additional issues, let me know.

from pytorch-deeplab-resnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.