speedplusbaseline icon indicating copy to clipboard operation
speedplusbaseline copied to clipboard

UnboundLocalError: local variable 'speed_q' referenced before assignment

Open ara-47 opened this issue 8 months ago • 1 comments

Hi, I have trained the model; however, while running this code snippet below:

python test.py --pretrained 'checkpoints/krn/synthetic_only/model_best.pth.tar' \
               --logdir 'log/krn/synthetic_only' --resultfn 'results.txt' \
               --model_name 'krn' --input_shape 224 224 \
               --test_domain 'synthetic' --test_csv 'validation.csv'

Got this error: speedplusbaseline/src/utils/metrics.py", line 66, in speed_score speed = speed_t + speed_q UnboundLocalError: local variable 'speed_q' referenced before assignment

I tried to track it, the condition in line 55 in metrics.py is not executing # Check if within threshold if applyThresh and err_q < rotThresh: speed_q = 0.0 This is because I am getting the value of err_q approximately 40.396.... Am I doing something wrong?

ara-47 avatar May 07 '25 13:05 ara-47

speed_r ->speed_q ?

Yancccccc avatar May 18 '25 02:05 Yancccccc