Zongwei97 / PopNet

[ICCV 23] Official implementation of Source-free Depth for Object Pop-out (One of First Attempts for RGB-D COD)
23 stars 3 forks source link

I find a code error when training #2

Closed dongzhi128128 closed 1 year ago

dongzhi128128 commented 1 year ago

Traceback (most recent call last): File "train.py", line 192, in train(train_loader, model, optimizer, epoch, save_path) File "train.py", line 108, in train loss7 = structure_loss(thresh, gts) UnboundLocalError: local variable 'thresh' referenced before assignment

I don't understand or the code is something wrong.

By the way, in loss.py, get_gradient and cos are undefined, but I can find them in other py, it's ok.

Zongwei97 commented 1 year ago

Hi,

Thanks a lot for your interest in our work and for pointing out the errors ... I wanted to restructure the code, and apparently, it led to some errors...

Indeed, the cos in loss.py can be found in train.py The thresh in train.py can be found several lines later. You can move the line loss7 just before the line of total loss.

I have checked and updated all of them.

Thanks again

dongzhi128128 commented 1 year ago

Your paper attracted me very much and I am very grateful for your efficiency in solving my problem