SegNetCMR icon indicating copy to clipboard operation
SegNetCMR copied to clipboard

SyntaxError: invalid syntax print(f"Reached MAX_STEP: {MAX_STEP} at step: {global_step_value}")

Open idhamari opened this issue 7 years ago • 4 comments

I got many errors related to the print statement. File "train.py", line 82 print(f"Reached MAX_STEP: {MAX_STEP} at step: {global_step_value}") ^ SyntaxError: invalid syntax

idhamari avatar Mar 15 '18 10:03 idhamari

Check you are using Python >=3.6 It is using f-strings.

On 15 March 2018 at 10:29, idhamari [email protected] wrote:

I got many errors related to the print statement. File "train.py", line 82 print(f"Reached MAX_STEP: {MAX_STEP} at step: {global_step_value}") ^ SyntaxError: invalid syntax

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mshunshin/SegNetCMR/issues/5, or mute the thread https://github.com/notifications/unsubscribe-auth/ABaQNnywDLWcvWoHoJZPx8X_3BgIVs35ks5tekJ9gaJpZM4Sr5Tc .

mshunshin avatar Mar 16 '18 21:03 mshunshin

Thanks for concern and quick reply. I am using python 2.7 (I built all other tools using it). Is there a way to make it works in python 2.7? or shall I rebuild all other tools in python 3? do you think there will be no conflict?

idhamari avatar Mar 16 '18 21:03 idhamari

I think it’s only a few of the print statements I use for python 3.6 features - but can’t promise.

Change them from

print(f”This is the result: {result}, and another result: {result2}”) to print(“This is the result: {0}, and another result: {1}”.format(result, result2))

etc…

Have you tried using the anaconda python distribution - I find it works very well on windows and Mac for tensor flow and scientific use. No compiling needed, and has recent versions of tensor flow.

On 16 Mar 2018, at 23:21, idhamari [email protected] wrote:

Thanks for concern and quick reply. I am using python 2.7 (I built all other tools using it). Is there a way to make it works in python 2.7? or shall I rebuild all other tools in python 3? do you think there will be no conflict?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

mshunshin avatar Mar 16 '18 21:03 mshunshin

Thanks for explaining, I will try your suggestion. I am using pip and Ubuntu 16 system.

idhamari avatar Mar 16 '18 21:03 idhamari