ENAS-pytorch icon indicating copy to clipboard operation
ENAS-pytorch copied to clipboard

SyntaxError: invalid syntax

Open zhjmcjk opened this issue 7 years ago • 3 comments

hello, guys. I have implemented ENAS-pytorch on my computer. When I run this command: python main.py --network_type rnn --dataset ptb --controller_optim adam --controller_lr 0.00035 --shared_optim sgd --shared_lr 20.0 --entropy_coeff 0.0001 i got a SyntaxError as the picture shown:

image

zhjmcjk avatar Sep 27 '18 09:09 zhjmcjk

You need Python 3.6 :). Or just remove the f.

beduffy avatar Sep 27 '18 12:09 beduffy

Wow, it seems working well when I remove the f. Thanks for your help! By the way, the version of Python I used is 3.5. how the f works in Python 3.6, and why it can't work in Python 3.5.
I am sorry for the inconvenience. @beduffy

zhjmcjk avatar Sep 27 '18 12:09 zhjmcjk

https://cito.github.io/blog/f-strings/

It was only added for the first time in Python 3.6

beduffy avatar Sep 27 '18 15:09 beduffy