thograce / BGNet

Boundary-Guided Camouflaged Object Detection
87 stars 17 forks source link

When I test I get the following error #2

Open dante1024 opened 2 years ago

dante1024 commented 2 years ago

When I test I get the following error:

Traceback (most recent call last): File "etest.py", line 30, in image, gt, name = test_loader.load_data() File "/data/zjb/camo/BGNet-master/utils/tdataloader.py", line 113, in load_data gt = self.binary_loader(self.gts[self.index]) IndexError: list index out of range

What's wrong with this error?

thograce commented 2 years ago

When I test I get the following error:

Traceback (most recent call last): File "etest.py", line 30, in image, gt, name = test_loader.load_data() File "/data/zjb/camo/BGNet-master/utils/tdataloader.py", line 113, in load_data gt = self.binary_loader(self.gts[self.index]) IndexError: list index out of range

What's wrong with this error?

Maybe the dataset link is wrong, but I can't confirm it now. I'll reply to you again after handling it.

dante1024 commented 2 years ago

When I test I get the following error: Traceback (most recent call last): File "etest.py", line 30, in image, gt, name = test_loader.load_data() File "/data/zjb/camo/BGNet-master/utils/tdataloader.py", line 113, in load_data gt = self.binary_loader(self.gts[self.index]) IndexError: list index out of range What's wrong with this error?

Maybe the dataset link is wrong, but I can't confirm it now. I'll reply to you again after handling it.

I have solved it, in tdataloader.py line 98 self.gts = [gt_root + f for f in os.listdir(gt_root) if f.endswith('.jpg')] should be changed to self.gts = [gt_root + f for f in os.listdir(gt_root) if f.endswith('.png')] , GT is a png image, so when loading GT here, it should be in png format

thograce commented 2 years ago

When I test I get the following error: Traceback (most recent call last): File "etest.py", line 30, in image, gt, name = test_loader.load_data() File "/data/zjb/camo/BGNet-master/utils/tdataloader.py", line 113, in load_data gt = self.binary_loader(self.gts[self.index]) IndexError: list index out of range What's wrong with this error?

Maybe the dataset link is wrong, but I can't confirm it now. I'll reply to you again after handling it.

I have solved it, in tdataloader.py line 98 self.gts = [gt_root + f for f in os.listdir(gt_root) if f.endswith('.jpg')] should be changed to self.gts = [gt_root + f for f in os.listdir(gt_root) if f.endswith('.png')] , GT is a png image, so when loading GT here, it should be in png format

Yes, you're right. I'll correct it.

dante1024 commented 2 years ago

When I test I get the following error: Traceback (most recent call last): File "etest.py", line 30, in image, gt, name = test_loader.load_data() File "/data/zjb/camo/BGNet-master/utils/tdataloader.py", line 113, in load_data gt = self.binary_loader(self.gts[self.index]) IndexError: list index out of range What's wrong with this error?

Maybe the dataset link is wrong, but I can't confirm it now. I'll reply to you again after handling it.

I have solved it, in tdataloader.py line 98 self.gts = [gt_root + f for f in os.listdir(gt_root) if f.endswith('.jpg')] should be changed to self.gts = [gt_root + f for f in os.listdir(gt_root) if f.endswith('.png')] , GT is a png image, so when loading GT here, it should be in png format

Yes, you're right. I'll correct it.

By the way, does batchsize have a big impact on the results? The batchsize used in the original paper is 16, and the batchsize I use is 2. The test indicators of the model I trained are very different from the original paper.

thograce commented 2 years ago

When I test I get the following error: Traceback (most recent call last): File "etest.py", line 30, in image, gt, name = test_loader.load_data() File "/data/zjb/camo/BGNet-master/utils/tdataloader.py", line 113, in load_data gt = self.binary_loader(self.gts[self.index]) IndexError: list index out of range What's wrong with this error?

Maybe the dataset link is wrong, but I can't confirm it now. I'll reply to you again after handling it.

I have solved it, in tdataloader.py line 98 self.gts = [gt_root + f for f in os.listdir(gt_root) if f.endswith('.jpg')] should be changed to self.gts = [gt_root + f for f in os.listdir(gt_root) if f.endswith('.png')] , GT is a png image, so when loading GT here, it should be in png format

Yes, you're right. I'll correct it.

By the way, does batchsize have a big impact on the results? The batchsize used in the original paper is 16, and the batchsize I use is 2. The test indicators of the model I trained are very different from the original paper.

If you only modify the batchsize without adjusting the learning rate, you will definitely not get similar results.

thograce commented 2 years ago

When I test I get the following error: Traceback (most recent call last): File "etest.py", line 30, in image, gt, name = test_loader.load_data() File "/data/zjb/camo/BGNet-master/utils/tdataloader.py", line 113, in load_data gt = self.binary_loader(self.gts[self.index]) IndexError: list index out of range What's wrong with this error?

Maybe the dataset link is wrong, but I can't confirm it now. I'll reply to you again after handling it.

I have solved it, in tdataloader.py line 98 self.gts = [gt_root + f for f in os.listdir(gt_root) if f.endswith('.jpg')] should be changed to self.gts = [gt_root + f for f in os.listdir(gt_root) if f.endswith('.png')] , GT is a png image, so when loading GT here, it should be in png format

Yes, you're right. I'll correct it.

By the way, does batchsize have a big impact on the results? The batchsize used in the original paper is 16, and the batchsize I use is 2. The test indicators of the model I trained are very different from the original paper.

If you only modify the batchsize without adjusting the learning rate, you will definitely not get similar results.

batchsize: 2, lr: 1.25e-5 or 1.5e-5. You can try this setting.