在阅读GitHub上的很多开源代码的时候我们总是无法安装作者的环境,导致代码运行失败,这时我们可以通过作者在GitHub项目中提供的dockerfile来构建一个docker环境,这样就可以直接运行作者的项目了。
下面是Hierarchical Multi-Scale Attention for Semantic Segmentation这篇语义分割网络提供的Dockerfile文件(想要自己构建,具体怎么构建文件,请自行百度)
FROM nvcr.io/nvidia/pytorch:19.10-py3
RUN pip install --no-cache-dir runx==0.0.6
RUN pip install --no-cache-dir numpy
RUN pip install --no-cache-dir sklearn
RUN pip install --no-cache-dir h5py
RUN pip install --no-cache-dir jupyter
RUN pip install --no-cache-dir scikit-image
RUN pip install --no-cache-dir pillow
RUN pip install --no-cache-dir piexif
RUN pip install --no-cache-dir cffi
RUN pip install --no-cache-dir tqdm
RUN pip install --no-cache-dir dominate
RUN pip install --no-cache-dir opencv-python
RUN pip install --no-cache-dir nose
RUN pip install --no-cache-dir ninja
RUN apt-get update && apt-get install libgtk2.0-dev -y && r