Python 尝试将tensorboard与google colab一起使用时出错
我在尝试与谷歌合作使用tensorboard时出错。 我正在使用ngork运行张力板。错误如下Python 尝试将tensorboard与google colab一起使用时出错,python,tensorflow,tensorboard,google-colaboratory,Python,Tensorflow,Tensorboard,Google Colaboratory,我在尝试与谷歌合作使用tensorboard时出错。 我正在使用ngork运行张力板。错误如下 LOG_DIR = '/content/drive/My Drive/Practice/Su' get_ipython().system_raw( 'tensorboard --logdir {} --host 0.0.0.0 --port 6006 &' .format(LOG_DIR) ) !wget https://bin.equinox.io/c/4VmDzA7iaH
LOG_DIR = '/content/drive/My Drive/Practice/Su'
get_ipython().system_raw(
'tensorboard --logdir {} --host 0.0.0.0 --port 6006 &'
.format(LOG_DIR)
)
!wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-
amd64.zip
!unzip ngrok-stable-linux-amd64.zip
get_ipython().system_raw('./ngrok http 6006 &')
! curl -s http://localhost:4040/api/tunnels | python3 -c \
"import sys, json; print(json.load(sys.stdin)['tunnels'][0]
['public_url'])"
我用于执行上述操作的代码如下
LOG_DIR = '/content/drive/My Drive/Practice/Su'
get_ipython().system_raw(
'tensorboard --logdir {} --host 0.0.0.0 --port 6006 &'
.format(LOG_DIR)
)
!wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-
amd64.zip
!unzip ngrok-stable-linux-amd64.zip
get_ipython().system_raw('./ngrok http 6006 &')
! curl -s http://localhost:4040/api/tunnels | python3 -c \
"import sys, json; print(json.load(sys.stdin)['tunnels'][0]
['public_url'])"
跳过ngrok并使用内置的tensorboard魔术板 下面是一个演示:
这里有一个对我有效的解决方案: 首先卸载tensorboard和tensorflow:
!pip3 uninstall tensorboard
!pip3 uninstall tensorflow
然后每晚安装tf:
!pip3 install --ignore-installed tf-nightly
然后在google colab中运行tensorboard:
%load_ext tensorboard
%tensorboard --logdir {logs_base_dir}
工作环节