Google Colab ngrok convert to python

吃可爱长大的小学妹 提交于 2019-12-23 04:48:29

问题


I have a Google Colab notebook with following commands

!wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip

!unzip ngrok-stable-linux-amd64.zip

LOG_DIR = './log'
get_ipython().system_raw(
    'tensorboard --logdir {} --host 0.0.0.0 --port 6006 &'
    .format(LOG_DIR)
)

These commands run very well without any error in Google Colab . But when I run the same in python get error.

Python demo.py

import sys, json
import requests
from IPython import get_ipython
import requests

LOG_DIR = './log'

get_ipython().system_raw(
    'tensorboard --logdir {} --host 0.0.0.0 --port 8001 &'
    .format(LOG_DIR)
)

ERROR: line 9: AttributeError: 'NoneType' object has no attribute 'system_raw'

How do I resolve this error in python ?

来源:https://stackoverflow.com/questions/59340864/google-colab-ngrok-convert-to-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!