Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
which python
python -m pip install --upgrade pip wheel
python -m pip uninstall -y torch torchvision
python -m pip install torch==1.10.1+cu111 torchvision==0.11.2+cu111 -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install torch==1.11+cu111 torchvision==0.12+cu111 -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install -r requirements-dev.txt
- name: Run integration tests
run: |
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/pythonapp-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- "PT19+CUDA114"
- "PT110+CUDA116"
- "PT110+CUDA102"
- "PT111+CUDA102"
include:
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes
- environment: PT17+CUDA102
Expand All @@ -51,6 +52,9 @@ jobs:
- environment: PT110+CUDA102
pytorch: "torch==1.10.1 torchvision==0.11.2"
base: "nvcr.io/nvidia/cuda:10.2-devel-ubuntu18.04"
- environment: PT111+CUDA102
pytorch: "torch==1.11.0 torchvision==0.12.0"
base: "nvcr.io/nvidia/cuda:10.2-devel-ubuntu18.04"
container:
image: ${{ matrix.base }}
options: --gpus all
Expand All @@ -61,7 +65,8 @@ jobs:
run: |
if [ ${{ matrix.environment }} = "PT17+CUDA102" ] || \
[ ${{ matrix.environment }} = "PT18+CUDA102" ] || \
[ ${{ matrix.environment }} = "PT110+CUDA102" ]
[ ${{ matrix.environment }} = "PT110+CUDA102" ] || \
[ ${{ matrix.environment }} = "PT111+CUDA102" ]
then
PYVER=3.7 PYSFX=3 DISTUTILS=python3-distutils && \
apt-get update && apt-get install -y --no-install-recommends \
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/pythonapp-min.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ jobs:
- if: runner.os == 'windows'
name: Install torch cpu from pytorch.org (Windows only)
run: |
python -m pip install torch==1.10.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install torch==1.11.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
- name: Install the dependencies
run: |
# min. requirements
python -m pip install torch==1.10.1
python -m pip install torch==1.11.0
python -m pip install -r requirements-min.txt
python -m pip list
BUILD_MONAI=0 python setup.py develop # no compile of extensions
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
- name: Install the dependencies
run: |
# min. requirements
python -m pip install torch==1.10.1
python -m pip install torch==1.11.0
python -m pip install -r requirements-min.txt
python -m pip list
BUILD_MONAI=0 python setup.py develop # no compile of extensions
Expand All @@ -119,7 +119,7 @@ jobs:
strategy:
fail-fast: false
matrix:
pytorch-version: [1.6.0, 1.7.1, 1.8.1, 1.9.1, latest]
pytorch-version: [1.6.0, 1.7.1, 1.8.1, 1.9.1, 1.10.1, latest]
timeout-minutes: 40
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -156,6 +156,8 @@ jobs:
python -m pip install torch==1.8.1
elif [ ${{ matrix.pytorch-version }} == "1.9.1" ]; then
python -m pip install torch==1.9.1
elif [ ${{ matrix.pytorch-version }} == "1.10.1" ]; then
python -m pip install torch==1.10.1
fi
python -m pip install -r requirements-min.txt
python -m pip list
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ jobs:
- if: runner.os == 'windows'
name: Install torch cpu from pytorch.org (Windows only)
run: |
python -m pip install torch==1.10.1+cpu torchvision==0.11.2+cpu -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install torch==1.11.0+cpu torchvision==0.12.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
- name: Install the dependencies
run: |
python -m pip install torch==1.10.1 torchvision==0.11.2
python -m pip install torch==1.11.0 torchvision==0.12.0
cat "requirements-dev.txt"
python -m pip install -r requirements-dev.txt
python -m pip list
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/setupapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
python -m pip install --upgrade pip wheel
python -m pip uninstall -y torch torchvision
rm -rf $(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")/ruamel*
python -m pip install torch==1.10.1 torchvision==0.11.2
python -m pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 -f https://download.pytorch.org/whl/torch_stable.html
python -m pip install -r requirements-dev.txt
- name: Run unit tests report coverage
run: |
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
- name: Install the dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install torch==1.10.1 torchvision==0.11.2
python -m pip install torch==1.11.0 torchvision==0.12.0
python -m pip install -r requirements-dev.txt
- name: Run quick tests CPU ubuntu
run: |
Expand Down
6 changes: 3 additions & 3 deletions monai/apps/pathology/transforms/spatial/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def __call__(self, image: NdarrayOrTensor) -> NdarrayOrTensor:
c, h, w = img_np.shape
pad_h = (self.tile_size - h % self.tile_size) % self.tile_size
pad_w = (self.tile_size - w % self.tile_size) % self.tile_size
img_np = np.pad(
img_np = np.pad( # type: ignore
img_np,
[[0, 0], [pad_h // 2, pad_h - pad_h // 2], [pad_w // 2, pad_w - pad_w // 2]],
constant_values=self.background_val,
Expand All @@ -220,7 +220,7 @@ def __call__(self, image: NdarrayOrTensor) -> NdarrayOrTensor:
strides=(x_stride * x_step, y_stride * y_step, c_stride, x_stride, y_stride),
writeable=False,
)
img_np = llw.reshape(-1, c_image, h_tile, w_tile)
img_np = llw.reshape(-1, c_image, h_tile, w_tile) # type: ignore

# if keeping all patches
if self.tile_count is None:
Expand Down Expand Up @@ -251,7 +251,7 @@ def __call__(self, image: NdarrayOrTensor) -> NdarrayOrTensor:
img_np = img_np[self.random_idxs]

elif len(img_np) < self.tile_count:
img_np = np.pad(
img_np = np.pad( # type: ignore
img_np,
[[0, self.tile_count - len(img_np)], [0, 0], [0, 0], [0, 0]],
constant_values=self.background_val,
Expand Down
2 changes: 1 addition & 1 deletion monai/transforms/intensity/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ def __call__(self, img: NdarrayOrTensor, randomize: bool = True) -> NdarrayOrTen
img_min, img_max = img_np.min(), img_np.max()
reference_control_points_scaled = self.reference_control_points * (img_max - img_min) + img_min
floating_control_points_scaled = self.floating_control_points * (img_max - img_min) + img_min
img_np = np.asarray(
img_np = np.asarray( # type: ignore
np.interp(img_np, reference_control_points_scaled, floating_control_points_scaled), dtype=img_np.dtype
)
img, *_ = convert_to_dst_type(img_np, dst=img)
Expand Down
2 changes: 1 addition & 1 deletion monai/visualize/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def matshow3d(
vol = np.concatenate([pad(v) for v in vol], axis=0)
else: # ndarray
while len(vol.shape) < 3:
vol = np.expand_dims(vol, 0) # so that we display 2d as well
vol = np.expand_dims(vol, 0) # type: ignore # so that we display 2d as well

if channel_dim is not None: # move the expected dim to construct frames with `B` dim
vol = np.moveaxis(vol, frame_dim, -4) # type: ignore
Expand Down