pytorch - "MisconfigurationError: No TPU devices were found" even when TPU is connected in PyTorch Lightning
问题描述
Have been frustrated over the past few hours over a problem, though It's likely its a problem I started myself hah.
I'm trying to connect to the TPU in Colab. I'm pretty sure I've gotten all the import stuff down. My code is here. I'm not completely set on everything, so the entire document isn't functional, but you should be able to see my attempts at TPU connection.
I'm running Pytorch in version 1.5.0 and torchvision in 0.6.0 because I was finding I couldn't install XLA with anything later than 1.5.0. I'm running XLA in version 20200325.
This is the image that seems so confusing: It states that we have a connection with xla: 1 yet when trying to flag it in the trainer I get an error saying no TPUs can be found.
If anyone could help me, that would be amazing.
Thanks, A
解决方案
我遇到了同样的问题,这些步骤解决了这个问题。
- 遵循 PyTorch-Lightning 文档:TPU 支持
- 添加另一个笔记本单元格:
%%capture
!curl https://raw.githubusercontent.com/pytorch/xla/master/contrib/scripts/env-setup.py -o pytorch-xla-env-setup.py > /dev/null
!python pytorch-xla-env-setup.py --version nightly --apt-packages libomp5 libopenblas-dev > /dev/null
!pip install pytorch-lightning > /dev/null
推荐阅读
- r - 如何链接到提升 date_time
- python-3.x - 线程的 aiohttp 缓慢
- python - 如果仅使用两个级别,则 Matplotlib 轮廓孵化不起作用
- javascript - 为什么元素无法垂直居中对齐
- f# - F# 函数名称和指向该名称的函数值之间的区别
- gradle - 在 gradle 中是否可以发现给定 Maven 存储库中的哪些工件取决于给定“组:模块”的任何版本?
- makefile - Make:提取跟随已知路径的目标路径段
- python - 运算符字符串“array_contains”无效
- ios - 输入无效参数时 UUIDWithString 崩溃
- javascript - 如何处理由数组呈现的组件中一个元素/索引的样式?