![](/img/trans.png)
[英]Error loading Python lib '/tmp/_MEItueAuk/libpython3.7m.so.1.0': dlopen: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found
[英]Cannot import PyTorch/XLA for using TPU in CoLab with ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found
我想使用 TPU 在 Google Colab 上运行一个 PyTorch 程序,我使用以下代码在我的 CoLab 笔记本中安装了 PyTorch/XLA:
!pip install cloud-tpu-client==0.10 torch==1.12.0 https://storage.googleapis.com/tpu-pytorch/wheels/tpuvm/torch_xla-1.12-cp38-cp38-linux_x86_64.whl
然后,我通过import torch
成功导入了 pytorch 。
但是,当我尝试使用import torch_xla
时,我收到以下错误消息:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-4-7fe098b5b807> in <module>
----> 1 import torch_xla
/usr/local/lib/python3.8/dist-packages/torch_xla/__init__.py in <module>
99 from ._patched_functions import _apply_patches
100 from .version import __version__
--> 101 import _XLAC
102
103
ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /usr/local/lib/python3.8/dist-packages/torch_xla/lib/libxla_computation_client.so)
---------------------------------------------------------------------------
Python的版本是Python 3.8.15。
我认为也许将 Python 版本降级到 Python 3.7 可能会有所帮助,但是有没有不需要降级 Python 版本的解决方案?
https://storage.googleapis.com/tpu-pytorch/wheels/tpuvm/torch_xla-1.12-cp38-cp38-linux_x86_64.whl
看起来不像正确的 colab 轮。
如果你打算在 TPU 上运行 colab,你可以尝试命令.pip install cloud-tpu-client==0.10 torch==1.13:0 https.//storage.googleapis.com/tpu-pytorch/wheels/colab/torch_xla-1.13-cp38-cp38-linux_x86_64.whl
代替?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.