Skip to content

Commit

Permalink
Merge pull request #321 from Visual-Behavior/docker_torch1.13
Browse files Browse the repository at this point in the history
Docker torch1.13 PL 1.9 - Transform p=1.0
  • Loading branch information
thibo73800 authored Feb 16, 2023
2 parents 469114d + 2efae6f commit 033f45c
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 22 deletions.
37 changes: 37 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# tagged aloception-oss:cuda-11.3.1-pytorch1.10.1-lightning1.4.1

FROM nvidia/cuda:11.3.1-cudnn8-devel-ubuntu20.04
#FROM nvidia/cuda:11.6.0-cudnn8-devel-ubuntu20.04

ARG py=3.9
ARG pytorch=1.13.1
ARG torchvision=0.14.1
ARG torchaudio=0.13.1
ARG pytorch_lightning=1.9.0
ARG pycyda=11.7

ENV TZ=Europe/Paris
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update
RUN apt-get install -y build-essential nano git wget libgl1-mesa-glx

# Usefull for scipy
RUN apt-get install -y gfortran
# required for aloscene
RUN apt-get install -y libglib2.0-0


RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
RUN bash Miniconda3-latest-Linux-x86_64.sh -b -p /miniconda
ENV PATH=$PATH:/miniconda/condabin:/miniconda/bin
RUN /bin/bash -c "source activate base"
ENV HOME /workspace
WORKDIR /workspace

# Pytorch & pytorch litning
RUN conda install pytorch==${pytorch} torchvision==${torchvision} torchaudio==${torchaudio} pytorch-cuda=${pycuda} -c pytorch -c nvidia
RUN pip install pytorch_lightning==${pytorch_lightning}

COPY requirements-torch1.13.1.txt /install/requirements-torch1.13.1.txt
RUN pip install -r /install/requirements-torch1.13.1.txt
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<a href="https://visual-behavior.github.io/aloception-oss/">Documentation</a>

[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-0.3.0-green.svg)](https://conventionalcommits.org)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-0.5.0-green.svg)](https://conventionalcommits.org)

# Aloception open source software

Expand Down Expand Up @@ -75,6 +75,26 @@ training pipelines with **augmented tensors**.

## Installation

### Docker install

```
docker build -t aloception-oss:cuda-11.3.1-pytorch1.13.1-lightning1.9.0 .
```

```
docker run --gpus all -it -v /YOUR/WORKSPACE/:/workspace --privileged -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix aloception-oss:cuda-11.3.1-pytorch1.13.1-lightning1.9.0
```

Or without building the image

```
docker run --gpus all -it -v /YOUR/WORKSPACE/:/workspace --privileged -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix visualbehaviorofficial/aloception-oss:cuda-11.3.1-pytorch1.13.1-lightning1.9.0
```



### Pip install

You first need to install PyTorch 1.10.1 based on your hardware and environment
configuration. Please refer to the [pytorch website](https://pytorch.org/get-started/locally/) for this installation.

Expand Down
3 changes: 1 addition & 2 deletions alodataset/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


class AloTransform(object):
def __init__(self, same_on_sequence: bool = True, same_on_frames: bool = False, p: float = 0.5):
def __init__(self, same_on_sequence: bool = True, same_on_frames: bool = False, p: float = 1.0):
"""Alo Transform. Each transform in the project should
inhert from this class.
Expand Down Expand Up @@ -772,7 +772,6 @@ def apply(self, frame: Frame):
-------
n_frame: aloscene.Frame
"""

n_frame = frame.norm01()

frame_data = n_frame.data.as_tensor()
Expand Down
21 changes: 21 additions & 0 deletions requirements-torch1.13.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
pycocotools==2.0.2
PyYAML==5.4.1
chardet==4.0.0
idna==2.10

scipy==1.10.0

more_itertools==8.8.0
requests==2.25.1
opencv-python==4.7.0.68

python-dateutil==2.8.2
urllib3==1.26.6

protobuf==4.21.12
wandb==0.13.9

tqdm==4.62.3
captum==0.4.0

setuptools==59.5.0
18 changes: 0 additions & 18 deletions requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion unittest/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def tensor_equal(frame1, frame2):

def test_frame_from_dt():
# Go through the loaded sequence
for data in waymo_dataset.stream_loader():
for data in waymo_dataset.stream_loader(num_workers=1):
assert data["front"].shape[:2] == (2, 3)
assert data["front"].names == ("T", "C", "H", "W")
# It should be instance of list since the dataset return a sequence and the
Expand Down
7 changes: 7 additions & 0 deletions unittest/test_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from alodataset import transforms as T
import numpy as np
import torch
import random


def test_color_jitter():
Expand Down Expand Up @@ -78,4 +79,10 @@ def test_color_jitter():


if __name__ == "__main__":
# seed everything
seed = 42
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
test_color_jitter()

0 comments on commit 033f45c

Please sign in to comment.