简体   繁体   中英

tensorboard shows a SyntaxError: can't assign to operator

I'm trying to run tensorboard but it keeps showing the same error.

tensorboard --logdir=tensorflow/logdir
  File "<stdin>", line 1
SyntaxError: can't assign to operator

I'm using Ubuntu 16.04 and installed tensorflow-gpu by virtualenv.

You are running tensorboard --logdir=tensorflow/logdir from an interactive python shell or ipython/jupyter-notebook. As mentioned in the comment above, you need to run this command from the terminal. Alternatively, you can run the command from ipython/jupyter by putting the ! at the beginning of the command, ie by running !tensorboard --logdir=tensorflow/logdir

if you are using jupeter notebook or jupyter lab or google colab you should use the code:

%load_ext tensorboard
%tensorboard --logdir="logs"

if you are coding in terminal

tensorboard --logdir="logs"

this code will work well

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM