奇点图像在不同机器上的不同行为?

我尝试在远程计算机上运行基于 python3 的 Singularity 图像,但出现以下错误,而在其他计算机上则不会出现此错误:


singularity exec --nv --no-home --bind data/:/data/ image/ scripts/train.sh

+ singularity exec --nv --no-home --bind data/:/data/ image/ scripts/train.sh

WARNING: skipping mount of sysfs: no such file or directory

scripts/train.sh: line 8: warning: setlocale: LC_ALL: cannot change locale (en_US.utf8): No such file or directory

Python path configuration:

  PYTHONHOME = (not set)

  PYTHONPATH = '/usr/local/bin/python'

  program name = '/usr/local/bin/python'

  isolated = 0

  environment = 1

  user site = 1

  import site = 1

  sys._base_executable = '/usr/local/bin/python'

  sys.base_prefix = '/usr/local'

  sys.base_exec_prefix = '/usr/local'

  sys.executable = '/usr/local/bin/python'

  sys.prefix = '/usr/local'

  sys.exec_prefix = '/usr/local'

  sys.path = [

    '/usr/local/bin/python',

    '/usr/local/lib/python38.zip',

    '/usr/local/lib/python3.8',

    '/usr/local/lib/python3.8/lib-dynload',

  ]

Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding

Python runtime state: core initialized

LookupError: no codec search functions registered: can't find encoding


Current thread 0x00007f628ee51740 (most recent call first):

<no Python frame>


我的定义文件如下所示:


Bootstrap: docker

From: python:3


%post

    apt-get update  -y

    apt-get install -y git

    pip install torch torchvision

    git clone https://github.com/NVIDIA/apex

    cd apex

    pip install -v --no-cache-dir ./


%runscript

    echo "Running nnunet container..."

我该如何修复这个错误?为什么图像在不同的机器上表现不一样?


慕神8447489
浏览 104回答 1
1回答

一只斗牛犬

这通常是由于环境变量在没有注意到的情况下被传递或没有传递到容器。为了确保这不是问题,您可以使用-e或--cleanenv。这将防止任何没有前缀的变量SINGULARITYENV_加载到容器中。也就是说,警告WARNING: skipping mount of sysfs: no such file or directory也令人担忧:奇点无法安装/sys到图像中,因为它不存在于主机服务器上。这个特定的 python 错误似乎也是 Windows 10 特有的。Singularity 目前不支持 Windows,即使有 WSL2 的魔力。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python