如何解决有没有办法在Google Colab上使用变量检查器?
这是我第一次使用Google Colab。 是否可以在Google Collab中使用变量检查器? 如果可以,怎么办?
谢谢。
解决方法
是的。这就是我的方法。
将此代码放入一个代码单元中并运行它。
from google.colab import output
#I don't know why nbextensions don't work with python3.6
with output.temporary():
!pip install --upgrade git+https://github.com/Kreijstal/colab_inspector.git
!python2.7 -m pip install --upgrade git+https://github.com/blois/colab_inspector.git #yes,really.
!jupyter nbextension install --py inspector
import inspector
# open a scratch cell (Ctrl+Alt+N)
# run there
# inspector.watch_globals()
打开一个临时单元格(Ctrl + Alt + N)
在其上运行
inspector.watch_globals()
在左侧进行编码时,您将在右侧看到变量自动更新。您甚至可以扩展词典和其他内容。
参考:
- How to use Variable Inspector in Google colab?
- https://gist.github.com/Kreijstal/fb277585c6b31a4d82bb95cb91caf4e8
关键字: Google Colab,变量浏览器检查器可视化
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。