blogposts icon indicating copy to clipboard operation
blogposts copied to clipboard

local variable 'values' referenced before assignment

Open rasha-salim opened this issue 4 years ago • 4 comments

I'm getting this error when I run scheduler = torch.optim.lr_scheduler.LambdaLR(optimizer, lr_lambda) Annotation 2020-04-04 065232

rasha-salim avatar Apr 04 '20 03:04 rasha-salim

It was due to error in my implementation of lr_lambda function. Sorry about that. as the error stated, what happened is that the lambaLR second argument lr_lambda was missing because of this error and that what caused the reference before assignment error.

rasha-salim avatar Apr 06 '20 06:04 rasha-salim

@gamesMum I am also facing the same issue, could you please let me know, how you resolved the problem??

Sanket-DataEnt avatar Apr 09 '20 14:04 Sanket-DataEnt

@Sanket-DataEnt Check that lr_lambda is assignd to a value by executing this ine lr_lambda = lambda x: math.exp(x * math.log(end_lr / start_lr) / (lr_find_epochs * len( train_loader))) For me there was an error there.

rasha-salim avatar Apr 22 '20 03:04 rasha-salim

when i run the preprocess.py the first python script for streaming tweet, it works fine but I'm not able to view/store in the pubsub. i can't see. but the code runs without error as I print data in on_status method

pythonmjs avatar Jan 05 '22 20:01 pythonmjs