簡體   English   中英

無法導入 PyTorch/XLA 以在 CoLab 中使用 TPU 並出現 ImportError:/lib/x86_64-linux-gnu/libc.so.6:找不到版本“GLIBC_2.28”

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM