Skip to content

Commit

Permalink
fixed a bug of Upsample
Browse files Browse the repository at this point in the history
  • Loading branch information
li-li-github committed Oct 23, 2023
1 parent 1da4da5 commit 1b594ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,20 @@ information (protein ID) as a label to learn the localization patterns of protei
Recommended: create a new environment and install cytoself on the environment from pypi

(Optional) To run cytoself on GPUs, it is recommended to install pytorch GPU version before installing cytoself
following the [official instruction](https://pytorch.org/get-started/locally/).
following the [official instruction](https://pytorch.org/get-started/locally/). The way to install pytorch GPU may vary upon your OS and CUDA version.
```shell script
conda create -y -n cytoself python=3.9
conda activate cytoself
# (Optional: Install pytorch GPU following the official instruction)
pip install cytoself
```

### (For the developers) Install from this repository
Make sure you are in the root directory of the repository.

```bash
pip install -e .
```

### (For the developers) Install from this repository
Install development dependencies

```bash
pip install -r requirements/development.txt
pre-commit install
```


Expand Down Expand Up @@ -184,9 +179,10 @@ fig.show()

## Tested Environments

Rocky Linux 8.6, NVIDIA A100, CUDA 11.7 (GPU)
Rocky Linux 8.6, NVIDIA A100, CUDA 11.7 (GPU)<br/>
Ubuntu 20.04.3 LTS, NVIDIA 3090, CUDA 11.4 (GPU)<br/>
Ubuntu 22.04.3 LTS, NVIDIA 4090, CUDA 12.2 (GPU)

Ubuntu 20.04.3 LTS, NVIDIA 3090, CUDA 11.4 (GPU)

## Data Availability
The full data used in this work can be found here.
Expand Down
2 changes: 1 addition & 1 deletion cytoself/trainer/autoencoder/decoders/resnet2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(

for i in range(num_blocks):
if use_upsampling:
target_shape = tuple(np.ceil(output_shape[1:] / (2 ** (num_blocks - (i + 1)))).astype(int))
target_shape = tuple(np.ceil(output_shape[1:] / (2 ** (num_blocks - (i + 1)))).astype(int).tolist())
self.decoder[f'up{i + 1}'] = nn.Upsample(size=target_shape, mode=sampling_mode, align_corners=False)

self.decoder[f'resrep{i+1}'] = ResidualBlockRepeat(
Expand Down

0 comments on commit 1b594ba

Please sign in to comment.