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

Prediction does not run with torch 1.3 #62

Open
iparask opened this issue Oct 15, 2019 · 2 comments
Open

Prediction does not run with torch 1.3 #62

iparask opened this issue Oct 15, 2019 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@iparask
Copy link
Member

iparask commented Oct 15, 2019

I am trying to execute iceberg_seals.predicting with the following stack:

(SealsPytorch1) [paraskev@gpu045 unit.000066]$ python
Python 3.5.2 (default, Dec 16 2016, 08:52:16)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> import torchvision
>>> import tensorboardX
>>> torch.__version__
'1.3.0'
>>> torchvision.__version__
'0.4.1'
>>> tensorboardX.__version__
'1.9'
>>>

and I am getting the following error:

(SealsPytorch1) [paraskev@gpu045 unit.000066]$ iceberg_seals.predicting "--input_image" "WV03_20141120084907_1040010004AD7600_14NOV20084907-P1BS-500268558060_01_P001_u08rf3031.tif" "--model_architecture" "UnetCntWRN" "--hyperparameter_set" "A" "--training_set" "test_vanilla" "--test_folder" "/pylon5/mc3bggp/paraskev/SealsTest/test_image" "--model_path" "./" "--output_folder" "./WV03_20141120084907_1040010004AD7600_14NOV20084907-P1BS-500268558060_01_P001_u08rf3031"
Traceback (most recent call last):
  File "/pylon5/mc3bggp/paraskev/SealsPytorch1/bin/iceberg_seals.predicting", line 87, in <module>
    ['num_workers_train'])
  File "/pylon5/mc3bggp/paraskev/SealsPytorch1/lib/python3.5/site-packages/iceberg_seals/search/predicting/predict_sealnet.py", line 140, in predict_patch
    for data in dataloader:
  File "/pylon5/mc3bggp/paraskev/SealsPytorch1/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 819, in __next__
    return self._process_data(data)
  File "/pylon5/mc3bggp/paraskev/SealsPytorch1/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 846, in _process_data
    data.reraise()
  File "/pylon5/mc3bggp/paraskev/SealsPytorch1/lib/python3.5/site-packages/torch/_utils.py", line 385, in reraise
    raise self.exc_type(msg)
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/pylon5/mc3bggp/paraskev/SealsPytorch1/lib/python3.5/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
    data = fetcher.fetch(index)
  File "/pylon5/mc3bggp/paraskev/SealsPytorch1/lib/python3.5/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/pylon5/mc3bggp/paraskev/SealsPytorch1/lib/python3.5/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/pylon5/mc3bggp/paraskev/SealsPytorch1/lib/python3.5/site-packages/iceberg_seals/search/utils/dataloaders/data_loader_test.py", line 95, in __getitem__
    sample = self.transform(sample)
  File "/pylon5/mc3bggp/paraskev/SealsPytorch1/lib/python3.5/site-packages/torchvision/transforms/transforms.py", line 61, in __call__
    img = t(img)
  File "/pylon5/mc3bggp/paraskev/SealsPytorch1/lib/python3.5/site-packages/torchvision/transforms/transforms.py", line 166, in __call__
    return F.normalize(tensor, self.mean, self.std, self.inplace)
  File "/pylon5/mc3bggp/paraskev/SealsPytorch1/lib/python3.5/site-packages/torchvision/transforms/functional.py", line 217, in normalize
    tensor.sub_(mean[:, None, None]).div_(std[:, None, None])
RuntimeError: output with shape [1, 224, 224] doesn't match the broadcast shape [3, 224, 224]

(SealsPytorch1) [paraskev@gpu045 unit.000066]$
@iparask iparask added the bug Something isn't working label Oct 15, 2019
@iparask iparask changed the title Prediction does not run with update prediction Prediction does not run with torch 1.3 Oct 25, 2019
@bspitzbart
Copy link
Contributor

Is this related to issue #65?

@iparask
Copy link
Member Author

iparask commented Apr 27, 2020

I am not sure. I think not, because it has to do with the dimensions of the output matrix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants