Comments (2)
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.
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)
- Training set Images HOT 1
- Problem with inference.py HOT 1
- Output images HOT 3
- Question about Image size and ratio HOT 2
- File name of the out put images HOT 4
- Detailed questions HOT 1
- Have you tested the trained model on public dataset? HOT 1
- Implementation different from the paper HOT 1
- Question about RetinaNet FPN implementation HOT 1
- How can I save the mask image of test? HOT 2
- epoch HOT 1
- Round off mask removing relavant areas HOT 2
- TypeError: unsupported operand type(s) for %: 'int' and 'NoneType' HOT 4
- Error connect ECONNREFUSED 127.0.0.1:13246
- a little wrong~
- Hi, I'm getting some problems with the inference code. The mask saliency and predictions generated are all black. I think the error occur with the tensor matrix. Did you have any problems like that? HOT 2
- ValueError: num_samples should be a positive integer value, but got num_samples=0 HOT 1
- how to see all test image results after run the inference.py? HOT 2
- train.py 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-pyramid-feature-attention-network-for-saliency-detection.