我正在集群上运行Docker容器,尝试运行开源代码:https://github.com/xinntao/BasicSR。然而,我遇到了以下错误:
据我所见,这是wandb包初始化时出错。
据我所见,这是wandb包初始化时出错。
Traceback (most recent call last):
File "/home/GAN/BasicSR-master/basicsr/train.py", line 251, in <module>
main()
File "/home/GAN/BasicSR-master/basicsr/train.py", line 152, in main
logger, tb_logger = init_loggers(opt)
File "/home/GAN/BasicSR-master/basicsr/train.py", line 72, in init_loggers
init_wandb_logger(opt)
File "/home/GAN/BasicSR-master/basicsr/utils/dist_util.py", line 81, in wrapper
return func(*args, **kwargs)
File "/home/GAN/BasicSR-master/basicsr/utils/logger.py", line 89, in init_wandb_logger
import wandb
File "/usr/local/lib/python3.9/site-packages/wandb/__init__.py", line 131, in <module>
api = InternalApi()
File "/usr/local/lib/python3.9/site-packages/wandb/apis/internal.py", line 17, in __init__
self.api = InternalApi(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/wandb/sdk/internal/internal_api.py", line 73, in __init__
self._settings = Settings(
File "/usr/local/lib/python3.9/site-packages/wandb/old/settings.py", line 25, in __init__
self._global_settings.read([Settings._global_path()])
File "/usr/local/lib/python3.9/site-packages/wandb/old/settings.py", line 105, in _global_path
util.mkdir_exists_ok(config_dir)
File "/usr/local/lib/python3.9/site-packages/wandb/util.py", line 687, in mkdir_exists_ok
os.makedirs(path)
File "/usr/local/lib/python3.9/os.py", line 215, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/usr/local/lib/python3.9/os.py", line 225, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/.config'
我试图在Dockerfile中添加一个用户,但是遇到了相同的错误。 我的Dockerfile:
FROM python:3
COPY requirements.txt /tmp/
RUN apt-get update
RUN apt-get install ffmpeg libsm6 libxext6 -y
RUN pip install pip --upgrade pip
RUN pip install imageio
RUN pip install matplotlib
RUN pip install numpy
RUN pip install opencv-python
RUN pip install pandas
RUN pip install Pillow
RUN pip install scipy
RUN pip install wandb
RUN pip install torch==1.7.1+cu101 torchvision==0.8.2+cu101 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
RUN pip install --requirement /tmp/requirements.txt
RUN useradd -ms /bin/bash admin
USER admin
ENV PYTHONPATH "${PYTHONPATH}:/home/GAN"
WORKDIR /home/
CMD /bin/bash