RobertCsordas / RFCN-tensorflow

RFCN implementation in TensorFlow
292 stars 137 forks source link

how can we adapt nonlocal vars to python 2.7? #3

Closed marmus12 closed 7 years ago

marmus12 commented 7 years ago

in InceptionResnetV2.py, there are two nonlocal variables called trainBnEntered and currBlock. In python 2.7, the keyword nonlocal is not defined. when I comment them out it seems to get problematic to finetune earlier layers. so how should we fix the code to make it suitable to python2.7?

RobertCsordas commented 7 years ago

I never used python 2.7, but I think the global keyword should be used instead.

marmus12 commented 7 years ago

I declared these variables as global in the functions that assign value to them and deleted the nonlocal statements. now I can train starting from any scope I want. so thank you for your help, your code is awesome!