diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 702a86d..2fb7019 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ concurrency: jobs: lint: - name: Quick Lint (PRs only) + name: Quick Lint runs-on: ubuntu-latest if: github.event_name == 'pull_request' steps: @@ -38,7 +38,6 @@ jobs: - name: Run linters run: | black --check . - flake8 . test: name: Full Tests diff --git a/docker/.dockerignore b/docker/.dockerignore new file mode 100644 index 0000000..05aff57 --- /dev/null +++ b/docker/.dockerignore @@ -0,0 +1,31 @@ +# Github workflows +.github/workflows/ + +# Python cache +**/__pycache__/ +**/*.py[cod] + +# venv +venv/ + +# Train datasets +data/train/ +data/test/ + +# Profiling scripts/ logs +profiler/ + +# Tests +tests/ + +# Model weights and checkpoints +model/weights/ +checkpoints/ + +# Model compression logic +compress/ + +# Temp files +*.log +*.tmp + diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..1fc0c8e --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,30 @@ +FROM python:3.13-slim +LABEL maintainer="soulsharp" +LABEL repository="Compress-Resnet" + +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends\ + build-essential libblas-dev liblapack-dev \ + && rm -rf /var/lib/apt/lists/* + +RUN python -m venv /opt/venv +ENV PATH="/opt/venv/bin:$PATH" + +WORKDIR /app +COPY requirements.txt . + +RUN --mount=type=cache,target=/root/.cache/pip \ + python -m pip install --upgrade pip \ + && python -m pip install torch==2.6.0 torchvision==0.21.0 --index-url https://download.pytorch.org/whl/cu126 \ + && python -m pip install -r requirements.txt + +COPY . . + +# Creates missing files that werent copied +RUN mkdir -p /data/test /model/weights + +# Container paths to datasets +ENV TEST_DATASET_PATH="/data/test" +ENV MODEL_WT_PATH="/model/weights" + +CMD ["python", "-m", "scripts.run_benchmark"] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 2bd4db5..b034247 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,14 @@ -ptflops -tensorboard -torch -torchvision -onnx -onnxruntime -onnxsim -numpy -matplotlib -torchinfo -PyYAML -pytorch-lightning -pytest -pytest-mock \ No newline at end of file +ptflops==0.7.5 +tensorboard==2.19.0 +# torch==2.8.0 +# torchvision==0.23.0 +# onnx +# onnxruntime +# onnxsim +numpy==2.0.2 +matplotlib==3.10.0 +torchinfo==1.8.0 +PyYAML==6.0.2 +pytorch-lightning==2.5.4 +pytest==8.4.1 +pytest-mock==3.14.1 \ No newline at end of file