This commit is contained in:
hailin 2025-09-20 16:29:58 +08:00
parent c8e8c1e9ff
commit 2e8ba323e1
1 changed files with 5 additions and 4 deletions

View File

@ -28,7 +28,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
RUN python3 -m pip install --no-cache-dir numpy requests packaging build RUN python3 -m pip install --no-cache-dir numpy requests packaging build
WORKDIR /opt WORKDIR /opt
RUN git clone --recursive -b v2.7.1 https://github.com/pytorch/pytorch.git # RUN git clone --recursive -b v2.8.0 https://github.com/pytorch/pytorch.git
COPY ./pytorch_2.8.0/ /opt/pytorch
WORKDIR /opt/pytorch WORKDIR /opt/pytorch
ENV MAX_JOBS=${MAX_JOBS} ENV MAX_JOBS=${MAX_JOBS}
@ -65,10 +66,10 @@ RUN set -e && \
RUN python3 -c "import torch, typing_extensions, sympy, jinja2, fsspec, networkx; print('✅ Torch:', torch.__version__)" RUN python3 -c "import torch, typing_extensions, sympy, jinja2, fsspec, networkx; print('✅ Torch:', torch.__version__)"
# ── 编译 torchvision 0.22.1 (依赖本地 torch) ──────────────────────────────── # ── 编译 torchvision 0.23.0 (依赖本地 torch) ────────────────────────────────
WORKDIR /opt WORKDIR /opt
# RUN git clone -b v0.22.1 https://github.com/pytorch/vision.git # RUN git clone -b v0.23.0 https://github.com/pytorch/vision.git
COPY ./vision_0.22.1/ /opt/vision COPY ./vision_0.23.0/ /opt/vision
WORKDIR /opt/vision WORKDIR /opt/vision
RUN python3 setup.py bdist_wheel && \ RUN python3 setup.py bdist_wheel && \
pip install --no-cache-dir --no-deps dist/torchvision-*.whl pip install --no-cache-dir --no-deps dist/torchvision-*.whl