Git Product home page Git Product logo

Comments (2)

sairajk avatar sairajk commented on July 17, 2024

Hi @karliell, you should only run the run_inference function of inference.py for this purpose. The run_inference function does not require you to have corresponding masks for the input images (check its dataloader for a better understanding). You should be good to go with this line commented.

from pytorch-pyramid-feature-attention-network-for-saliency-detection.

kayleeliyx avatar kayleeliyx commented on July 17, 2024

Hi! I did run inference.py. However, I got this error when I run this code:

E:\pro1\Scripts\python.exe E:/Research/PyTorch-Pyramid-Feature-Attention-Network-for-Saliency-Detection/inference.py
  0%|          | 0/1 [00:01<?, ?it/s]
Traceback (most recent call last):
  File "E:/Research/PyTorch-Pyramid-Feature-Attention-Network-for-Saliency-Detection/inference.py", line 104, in <module>
    calculate_mae(rt_args)
  File "E:/Research/PyTorch-Pyramid-Feature-Attention-Network-for-Saliency-Detection/inference.py", line 91, in calculate_mae
    for batch_idx, (inp_imgs, gt_masks) in enumerate(tqdm.tqdm(test_dataloader), start=1):
  File "E:\pro1\lib\site-packages\tqdm\std.py", line 1127, in __iter__
    for obj in iterable:
  File "E:\pro1\lib\site-packages\torch\utils\data\dataloader.py", line 345, in __next__
    data = self._next_data()
  File "E:\pro1\lib\site-packages\torch\utils\data\dataloader.py", line 856, in _next_data
    return self._process_data(data)
  File "E:\pro1\lib\site-packages\torch\utils\data\dataloader.py", line 881, in _process_data
    data.reraise()
  File "E:\pro1\lib\site-packages\torch\_utils.py", line 394, in reraise
    raise self.exc_type(msg)
IndexError: Caught IndexError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "E:\pro1\lib\site-packages\torch\utils\data\_utils\worker.py", line 178, in _worker_loop
    data = fetcher.fetch(index)
  File "E:\pro1\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "E:\pro1\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "E:\Research\PyTorch-Pyramid-Feature-Attention-Network-for-Saliency-Detection\src\dataloader.py", line 163, in __getitem__
    mask_img = cv2.imread(self.out_files[idx], 0)
IndexError: list index out of range


Process finished with exit code 1

You provide initial 3 images in ./data/DUTS/DUTS-TE/DUTS-TE-Image. I just add two more my own images in this folder and then run inference.py. It seems the number in masks and images folder should be the same. I don't know why.

Would you please help me with this? Thank you so much for your help!

from pytorch-pyramid-feature-attention-network-for-saliency-detection.

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.