Skip to content

Getting Error while compiling the code. #2

@jhabarsingh

Description

@jhabarsingh
Converting images to feature vectors:
  0%|                                                                                                                                            | 0/1200 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "model.py", line 75, in <module>
    vec = img2vec.getVec(I)
  File "model.py", line 48, in getVec
    image = self.normalize(self.toTensor(img)).unsqueeze(0).to(self.device)
  File "/home/jabby/projects/DOCMED/xray_classifier/env/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/jabby/projects/DOCMED/xray_classifier/env/lib/python3.6/site-packages/torchvision/transforms/transforms.py", line 226, in forward
    return F.normalize(tensor, self.mean, self.std, self.inplace)
  File "/home/jabby/projects/DOCMED/xray_classifier/env/lib/python3.6/site-packages/torchvision/transforms/functional.py", line 284, in normalize
    tensor.sub_(mean).div_(std)
RuntimeError: output with shape [1, 224, 224] doesn't match the broadcast shape [3, 224, 224]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions