thograce / BGNet

Boundary-Guided Camouflaged Object Detection
91 stars 19 forks source link

TypeError: unsupported operand type(s) for /: 'NoneType' and 'int' #7

Open WkangLiu opened 2 years ago

WkangLiu commented 2 years ago

When I replay eval.py I get the following error when test the : 'maxFm': 0.7736841486165681} 63%|██████▎ | 2605/4121 [06:05<02:38, 9.59it/s][ WARN:0@1050.869] global /io/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('./results/BGNet/NC4K/429.png'): can't open/read file: check file path/integrity 63%|██████▎ | 2606/4121 [06:05<03:32, 7.13it/s] Traceback (most recent call last): File "/ssdhome/qzb521/abc/BGNet/eval.py", line 30, in FM.step(pred=pred, gt=mask) File "/home/qzb521/miniconda3/envs/sinet/lib/python3.9/site-packages/py_sod_metrics/sod_metrics.py", line 65, in step pred, gt = _prepare_data(pred, gt) File "/home/qzb521/miniconda3/envs/sinet/lib/python3.9/site-packages/py_sod_metrics/sod_metrics.py", line 23, in _prepare_data pred = pred / 255 TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

It maybe not generate the predict image before eval it? What's wrong with this error?

thograce commented 1 year ago

When I replay eval.py I get the following error when test the : 'maxFm': 0.7736841486165681} 63%|██████▎ | 2605/4121 [06:05<02:38, 9.59it/s][ WARN:0@1050.869] global /io/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('./results/BGNet/NC4K/429.png'): can't open/read file: check file path/integrity 63%|██████▎ | 2606/4121 [06:05<03:32, 7.13it/s] Traceback (most recent call last): File "/ssdhome/qzb521/abc/BGNet/eval.py", line 30, in FM.step(pred=pred, gt=mask) File "/home/qzb521/miniconda3/envs/sinet/lib/python3.9/site-packages/py_sod_metrics/sod_metrics.py", line 65, in step pred, gt = _prepare_data(pred, gt) File "/home/qzb521/miniconda3/envs/sinet/lib/python3.9/site-packages/py_sod_metrics/sod_metrics.py", line 23, in _prepare_data pred = pred / 255 TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

It maybe not generate the predict image before eval it? What's wrong with this error?

If you want to generate images for testing, please run etest.py. The eval.py is used to calculate evaluation indicators. Before running eval.py, make sure that there are images in pre_root.

WkangLiu commented 1 year ago

Thanks! This is an oversight on my part.

thograce commented 1 year ago

Thanks! This is an oversight on my part.

By the way, you can download my test result image directly from pre-computed maps of BGNet, and then run eval.py.