Comments (7)
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.
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.
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:
-
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] -
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.
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.
Two points.
- 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.
- As for the error you are getting, can you verify and tell what is the size of
img
just before it is passed intoline 106
? A square image must be passed to the model. Failure to do so would result in this error.
Can you tell me whatprint img.shape
outputs just before the line which produces this error?
from pytorch-deeplab-resnet.
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.
If there are any additional issues, let me know.
from pytorch-deeplab-resnet.
Related Issues (20)
- Why is loss for multiple scales calculated in a strange way? HOT 2
- Arbitrary batch size still unimplemented?
- Training produces model generating blank segmentations HOT 6
- How do get car mask only? HOT 1
- how does iter_size work? HOT 1
- spatial sizes mismatch HOT 1
- the result? HOT 4
- Why change the image channel order after `cv2.imread`
- No Relu in the ClassifierModule HOT 1
- Frozen the statistics of BN? HOT 5
- The size of the prediction HOT 2
- Bad mIOU tested with provided model HOT 8
- problem of train.py HOT 1
- ASPP or LargeFOV? Should be 76.35%.
- docopt HOT 2
- network stucture issue
- read the ground truth of the pascal voc dataset
- where is the crfs implementation? HOT 1
- About image preprocessing HOT 2
- performance HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch-deeplab-resnet.