nagadomi / nunif

Misc; latest version of waifu2x; 2D video to stereo 3D video conversion
MIT License
1.58k stars 142 forks source link

An error occurred when using Docker to package images,Can you help me see how to solve this problem #121

Closed HAPPY-FAMILY closed 5 months ago

HAPPY-FAMILY commented 6 months ago

`[root@localhost nunif]# docker build -t nunif -f Dockerfiles/Dockerfile.cpu_noavx Dockerfiles [+] Building 50.7s (20/21) docker:default => [internal] load build definition from Dockerfile.cpu_noavx 0.0s => => transferring dockerfile: 2.54kB 0.0s => [internal] load metadata for docker.io/nvidia/cuda:11.8.0-runtime-ubuntu22.04 0.6s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [ 1/18] FROM docker.io/nvidia/cuda:11.8.0-runtime-ubuntu22.04@sha256:eaaccb3528ceca110601131434ab467e41d694a41e8c9bf280fb27ac18fcb29b 0.0s => CACHED [ 2/18] RUN apt-get update -y 0.0s => CACHED [ 3/18] RUN apt-get install -y git-core python3-pip libmagickwand-dev libraqm-dev wget libomp-dev libopenblas-dev gfortran libblas-dev m4 cmake python3-dev python3-yaml 0.0s => CACHED [ 4/18] RUN mkdir -p /root/src 0.0s => CACHED [ 5/18] WORKDIR /root/src 0.0s => CACHED [ 6/18] RUN pip3 uninstall torch torchvision torchtext torchaudio 0.0s => CACHED [ 7/18] RUN echo $'touch .gitignore \nCMAKE_BUILD_TYPE=RelWithDebInfo ATEN_CPU_CAPABILITY=default USE_CUDA=0 USE_AVX=0 USE_AVX2=0 USE_DISTRIBUTED=0 USE_NNPACK=0 USE_QNNPACK=0 USE_MK 0.0s => CACHED [ 8/18] RUN cat /root/src/build.sh 0.0s => CACHED [ 9/18] RUN echo " Build torch" 0.0s => CACHED [10/18] RUN wget -q https://github.com/pytorch/pytorch/releases/download/v1.13.1/pytorch-v1.13.1.tar.gz -O pytorch-v1.13.1.tar.gz && tar -xzf pytorch-v1.13.1.tar.gz && cd py 0.0s => CACHED [11/18] RUN echo " Build torchvision" 0.0s => CACHED [12/18] RUN wget -q https://github.com/pytorch/vision/archive/refs/tags/v0.14.1.tar.gz -O vision-0.14.1.tar.gz && tar -xzf vision-0.14.1.tar.gz && cd vision-0.14.1 && . 0.0s => CACHED [13/18] RUN echo " Build torchtext" 0.0s => CACHED [14/18] RUN git clone https://github.com/pytorch/text -b v0.14.1 torchtext-0.14.1 && cd torchtext-0.14.1 && . ../build.sh && pip3 install dist/.whl 0.0s => CACHED [15/18] WORKDIR /root 0.0s => CACHED [16/18] RUN rm -fr /root/src 0.0s => ERROR [17/18] RUN git clone https://github.com/nagadomi/nunif.git /root/nunif && cd /root/nunif && pip3 install -r requirements.txt && python3 -m waifu2x.download_models && 50.0s


[17/18] RUN git clone https://github.com/nagadomi/nunif.git /root/nunif && cd /root/nunif && pip3 install -r requirements.txt && python3 -m waifu2x.download_models && python3 -m waifu2x.web.webgen.gen:
0.396 Cloning into '/root/nunif'...
3.022 Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 5)) (1.26.4)
3.023 Requirement already satisfied: pillow in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 6)) (10.3.0)
3.024 Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 7)) (4.66.4) 3.259 Collecting wand>=0.6.10 3.368 Downloading Wand-0.6.13-py2.py3-none-any.whl (143 kB) 3.425 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.8/143.8 KB 2.6 MB/s eta 0:00:00 3.771 Collecting fonttools 3.778 Downloading fonttools-4.51.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.6 MB) 3.866 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.6/4.6 MB 54.2 MB/s eta 0:00:00 4.241 Collecting scipy 4.247 Downloading scipy-1.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (38.6 MB) 4.897 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 38.6/38.6 MB 44.5 MB/s eta 0:00:00 5.584 Collecting waitress 5.591 Downloading waitress-3.0.0-py3-none-any.whl (56 kB) 5.605 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 56.7/56.7 KB 8.5 MB/s eta 0:00:00 5.680 Collecting bottle 5.687 Downloading bottle-0.12.25-py3-none-any.whl (90 kB) 5.700 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.2/90.2 KB 12.3 MB/s eta 0:00:00 5.867 Collecting diskcache 5.874 Downloading diskcache-5.6.3-py3-none-any.whl (45 kB) 5.886 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 45.5/45.5 KB 6.8 MB/s eta 0:00:00 6.024 Collecting flake8 6.031 Downloading flake8-7.0.0-py2.py3-none-any.whl (57 kB) 6.043 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.6/57.6 KB 8.6 MB/s eta 0:00:00 6.049 Requirement already satisfied: psutil in /usr/local/lib/python3.10/dist-packages (from -r requirements.txt (line 15)) (5.9.8) 6.051 Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (from -r requirements.txt (line 16)) (5.4.1) 6.314 Collecting onnx 6.320 Downloading onnx-1.16.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.9 MB) 6.686 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 15.9/15.9 MB 42.9 MB/s eta 0:00:00 6.943 Collecting onnxconverter_common 6.947 Downloading onnxconverter_common-1.14.0-py2.py3-none-any.whl (84 kB) 6.954 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 84.5/84.5 KB 20.2 MB/s eta 0:00:00 7.039 Collecting lpips 7.043 Downloading lpips-0.1.4-py3-none-any.whl (53 kB) 7.050 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 53.8/53.8 KB 13.3 MB/s eta 0:00:00 7.107 Collecting packaging 7.112 Downloading packaging-24.0-py3-none-any.whl (53 kB) 7.118 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 53.5/53.5 KB 13.7 MB/s eta 0:00:00 7.240 Collecting timm 7.245 Downloading timm-0.9.16-py3-none-any.whl (2.2 MB) 7.288 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.2/2.2 MB 56.0 MB/s eta 0:00:00 7.640 Collecting numba 7.647 Downloading numba-0.59.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.7 MB) 7.714 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.7/3.7 MB 57.2 MB/s eta 0:00:00 7.905 Collecting av>=9.0.0 7.909 Downloading av-12.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (33.8 MB) 8.456 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 33.8/33.8 MB 47.0 MB/s eta 0:00:00 8.929 Collecting rembg 8.936 Downloading rembg-2.0.56-py3-none-any.whl (32 kB) 9.312 Collecting pycodestyle<2.12.0,>=2.11.0 9.318 Downloading pycodestyle-2.11.1-py2.py3-none-any.whl (31 kB) 9.373 Collecting mccabe<0.8.0,>=0.7.0 9.379 Downloading mccabe-0.7.0-py2.py3-none-any.whl (7.3 kB) 9.460 Collecting pyflakes<3.3.0,>=3.2.0 9.466 Downloading pyflakes-3.2.0-py2.py3-none-any.whl (62 kB) 9.478 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.7/62.7 KB 9.3 MB/s eta 0:00:00 10.20 Collecting protobuf>=3.20.2 10.20 Downloading protobuf-5.26.1-cp37-abi3-manylinux2014_x86_64.whl (302 kB) 10.21 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 302.8/302.8 KB 41.6 MB/s eta 0:00:00 10.25 Downloading protobuf-3.20.2-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.1 MB) 10.27 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 57.2 MB/s eta 0:00:00 10.29 Requirement already satisfied: torchvision>=0.2.1 in /usr/local/lib/python3.10/dist-packages (from lpips->-r requirements.txt (line 19)) (0.14.1a0) 10.29 Requirement already satisfied: torch>=0.4.0 in /usr/local/lib/python3.10/dist-packages (from lpips->-r requirements.txt (line 19)) (1.13.0a0+gitunknown) 10.74 Collecting safetensors 10.74 Downloading safetensors-0.4.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB) 10.77 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 57.8 MB/s eta 0:00:00 10.93 Collecting huggingface_hub 10.93 Downloading huggingface_hub-0.23.0-py3-none-any.whl (401 kB) 10.94 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 401.2/401.2 KB 47.0 MB/s eta 0:00:00 11.14 Collecting llvmlite<0.43,>=0.42.0dev0 11.14 Downloading llvmlite-0.42.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (43.8 MB) 11.85 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 43.8/43.8 MB 41.7 MB/s eta 0:00:00 12.46 Collecting pymatting 12.47 Downloading PyMatting-1.1.12-py3-none-any.whl (52 kB) 12.48 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 53.0/53.0 KB 8.2 MB/s eta 0:00:00 12.63 Collecting pooch 12.64 Downloading pooch-1.8.1-py3-none-any.whl (62 kB) 12.65 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 63.0/63.0 KB 11.3 MB/s eta 0:00:00 13.01 Collecting onnxruntime 13.02 Downloading onnxruntime-1.17.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (6.8 MB) 13.17 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.8/6.8 MB 45.7 MB/s eta 0:00:00 13.53 Collecting opencv-python-headless 13.54 Downloading opencv_python_headless-4.9.0.80-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (49.6 MB) 14.39 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 49.6/49.6 MB 36.9 MB/s eta 0:00:00 15.21 Collecting scikit-image 15.22 Downloading scikit_image-0.23.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.7 MB) 15.51 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.7/14.7 MB 48.6 MB/s eta 0:00:00 15.82 Collecting jsonschema 15.83 Downloading jsonschema-4.22.0-py3-none-any.whl (88 kB) 15.84 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 88.3/88.3 KB 12.5 MB/s eta 0:00:00 15.89 Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from torch>=0.4.0->lpips->-r requirements.txt (line 19)) (4.11.0) 15.90 Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from torchvision>=0.2.1->lpips->-r requirements.txt (line 19)) (2.31.0) 16.21 Collecting fsspec>=2023.5.0 16.21 Downloading fsspec-2024.3.1-py3-none-any.whl (171 kB) 16.22 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 172.0/172.0 KB 29.0 MB/s eta 0:00:00 16.29 Collecting filelock 16.29 Downloading filelock-3.14.0-py3-none-any.whl (12 kB) 17.08 Collecting rpds-py>=0.7.1 17.09 Downloading rpds_py-0.18.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB) 17.11 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 53.7 MB/s eta 0:00:00 17.20 Collecting referencing>=0.28.4 17.20 Downloading referencing-0.35.1-py3-none-any.whl (26 kB) 17.21 Requirement already satisfied: attrs>=22.2.0 in /usr/local/lib/python3.10/dist-packages (from jsonschema->rembg->-r requirements.txt (line 27)) (23.2.0) 17.24 Collecting jsonschema-specifications>=2023.03.6 17.25 Downloading jsonschema_specifications-2023.12.1-py3-none-any.whl (18 kB) 17.29 Collecting flatbuffers 17.29 Downloading flatbuffers-24.3.25-py2.py3-none-any.whl (26 kB) 17.30 Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from onnxruntime->rembg->-r requirements.txt (line 27)) (1.12) 17.35 Collecting coloredlogs 17.35 Downloading coloredlogs-15.0.1-py2.py3-none-any.whl (46 kB) 17.35 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.0/46.0 KB 12.8 MB/s eta 0:00:00 17.45 Collecting platformdirs>=2.5.0 17.45 Downloading platformdirs-4.2.1-py3-none-any.whl (17 kB) 17.72 Collecting networkx>=2.8 17.73 Downloading networkx-3.3-py3-none-any.whl (1.7 MB) 17.76 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB 63.7 MB/s eta 0:00:00 17.85 Collecting imageio>=2.33 17.85 Downloading imageio-2.34.1-py3-none-any.whl (313 kB) 17.86 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 313.5/313.5 KB 44.8 MB/s eta 0:00:00 17.96 Collecting tifffile>=2022.8.12 17.96 Downloading tifffile-2024.5.3-py3-none-any.whl (225 kB) 17.97 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 225.3/225.3 KB 41.2 MB/s eta 0:00:00 18.06 Collecting lazy-loader>=0.4 18.06 Downloading lazy_loader-0.4-py3-none-any.whl (12 kB) 18.33 Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->torchvision>=0.2.1->lpips->-r requirements.txt (line 19)) (2024.2.2) 18.33 Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->torchvision>=0.2.1->lpips->-r requirements.txt (line 19)) (2.2.1) 18.33 Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->torchvision>=0.2.1->lpips->-r requirements.txt (line 19)) (3.3.2) 18.33 Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->torchvision>=0.2.1->lpips->-r requirements.txt (line 19)) (3.7) 18.42 Collecting humanfriendly>=9.1 18.43 Downloading humanfriendly-10.0-py2.py3-none-any.whl (86 kB) 18.43 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 86.8/86.8 KB 22.0 MB/s eta 0:00:00 18.47 Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->onnxruntime->rembg->-r requirements.txt (line 27)) (1.3.0) 19.36 Installing collected packages: wand, flatbuffers, bottle, waitress, tifffile, scipy, safetensors, rpds-py, pyflakes, pycodestyle, protobuf, platformdirs, packaging, opencv-python-headless, networkx, mccabe, llvmlite, imageio, humanfriendly, fsspec, fonttools, filelock, diskcache, av, referencing, pooch, onnx, numba, lazy-loader, huggingface_hub, flake8, coloredlogs, timm, scikit-image, pymatting, onnxruntime, onnxconverter_common, lpips, jsonschema-specifications, jsonschema, rembg 45.91 Successfully installed av-12.0.0 bottle-0.12.25 coloredlogs-15.0.1 diskcache-5.6.3 filelock-3.14.0 flake8-7.0.0 flatbuffers-24.3.25 fonttools-4.51.0 fsspec-2024.3.1 huggingface_hub-0.23.0 humanfriendly-10.0 imageio-2.34.1 jsonschema-4.22.0 jsonschema-specifications-2023.12.1 lazy-loader-0.4 llvmlite-0.42.0 lpips-0.1.4 mccabe-0.7.0 networkx-3.3 numba-0.59.1 onnx-1.16.0 onnxconverter_common-1.14.0 onnxruntime-1.17.3 opencv-python-headless-4.9.0.80 packaging-24.0 platformdirs-4.2.1 pooch-1.8.1 protobuf-3.20.2 pycodestyle-2.11.1 pyflakes-3.2.0 pymatting-1.1.12 referencing-0.35.1 rembg-2.0.56 rpds-py-0.18.0 safetensors-0.4.3 scikit-image-0.23.2 scipy-1.13.0 tifffile-2024.5.3 timm-0.9.16 waitress-3.0.0 wand-0.6.13 45.91 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv 48.64 Traceback (most recent call last): 48.64 File "/usr/lib/python3.10/runpy.py", line 187, in _run_module_as_main 48.64 mod_name, mod_spec, code = _get_module_details(mod_name, _Error) 48.64 File "/usr/lib/python3.10/runpy.py", line 110, in _get_module_details 48.64 import(pkg_name) 48.64 File "/root/nunif/waifu2x/init.py", line 1, in 48.64 from .utils import Waifu2x 48.64 File "/root/nunif/waifu2x/utils.py", line 5, in 48.64 from nunif.transforms.tta import tta_merge, tta_split 48.64 File "/root/nunif/nunif/init.py", line 2, in 48.64 from . import modules 48.64 File "/root/nunif/nunif/modules/init.py", line 2, in 48.65 from . lbp_loss import LBPLoss 48.65 File "/root/nunif/nunif/modules/lbp_loss.py", line 20, in 48.65 class LBPLoss(nn.Module): 48.65 File "/root/nunif/nunif/modules/lbp_loss.py", line 37, in LBPLoss 48.65 def forward(self, input, target): 48.65 File "/root/nunif/nunif/modules/compile_wrapper.py", line 12, in compile 48.65 return torch.compile(*args, **kwargs) 48.65 AttributeError: module 'torch' has no attribute 'compile'

Dockerfile.cpu_noavx:77

76 |
77 | >>> RUN git clone https://github.com/nagadomi/nunif.git /root/nunif && \ 78 | >>> cd /root/nunif && \ 79 | >>> pip3 install -r requirements.txt && \ 80 | >>> python3 -m waifu2x.download_models && \ 81 | >>> python3 -m waifu2x.web.webgen.gen 82 |

ERROR: failed to solve: process "/bin/bash -c git clone https://github.com/nagadomi/nunif.git /root/nunif && cd /root/nunif && pip3 install -r requirements.txt && python3 -m waifu2x.download_models && python3 -m waifu2x.web.webgen.gen" did not complete successfully: exit code: 1`

nagadomi commented 6 months ago

pytorch built with that Dockerfile is very old and needs to be upgraded to 2.0 or later.

nagadomi commented 6 months ago

I have updated dockerfiles https://github.com/nagadomi/nunif/commit/18153e9a758fc92a6fe3136475a56a6d74fb61af Not tested on a machine which has no AVX.