在 Alpine 上使用 pytorch

dy *_*ong 5 glibc docker alpine-linux pytorch

我在 alpine 有一个 docker 镜像,需要在其上使用 pytorch。不过按照pytorch网站上的说明,需要glibc才能运行,否则会报如下错误

import torch
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.7/site-packages/torch/__init__.py", line 189, in <module>
    _load_global_deps()
  File "/usr/lib/python3.7/site-packages/torch/__init__.py", line 142, in _load_global_deps
    ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
  File "/usr/lib/python3.7/ctypes/__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: Error relocating /usr/lib/python3.7/site-packages/torch/lib/libgomp-7c85b1e2.so.1: pthread_attr_setaffinity_np: symbol not found
Run Code Online (Sandbox Code Playgroud)

我尝试从https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-2.29-r0.apk安装 glibc ,但错误信息保持不变。