Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edits to run on jupyterhub gpu #7

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
4 changes: 4 additions & 0 deletions PatchTST-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ channels:
- conda-forge
- wfp-ram
- pytorch
- nvidia
dependencies:
- python =3.10
- pip >=22
- hip-analysis >=0.2.0
- pytorch==1.11.0
- torchvision==0.12.0
- torchaudio==0.11.0
- cudatoolkit=10.2
- xbatcher
- cachey
- jupyterlab
Expand Down
2 changes: 1 addition & 1 deletion PatchTST_self_supervised/src/data/datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(
shuffle_train = True,
shuffle_val = False,
drop_last = True,
prefetch_factor = None
prefetch_factor: int= 2

):
super().__init__()
Expand Down
4 changes: 2 additions & 2 deletions SeasonTST/SeasonTST_finetune.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ def load_config():
"mask_ratio": 0.4, # masking ratio for the input
"lr": 1e-3,
"batch_size": 128,
"num_workers": 6,
"prefetch_factor": 3,
"num_workers": 0,
"prefetch_factor": 2,
"n_epochs_pretrain": 1, # number of pre-training epochs,
"freeze_epochs": 0,
"n_epochs_finetune": 250,
Expand Down
4 changes: 2 additions & 2 deletions SeasonTST/SeasonTST_pretrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ def load_config():
"mask_value": -99, # Value to assign to masked elements of data input
"lr": 1e-3,
"batch_size": 128,
"prefetch_factor": 3,
"num_workers": 6,
"prefetch_factor": 2,
"num_workers": 0,
"n_epochs_pretrain": 1, # number of pre-training epochs
"pretrained_model_id": 2500, # id of the saved pretrained model
}
Expand Down
3 changes: 2 additions & 1 deletion SeasonTST/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ def plot_loss(train_loss, valid_loss, save_path):
def load_data():

# Load dataset. Ensure it has no nans
PREFIX = "https://data.earthobservation.vam.wfp.org/public-share/"
#PREFIX = "https://data.earthobservation.vam.wfp.org/public-share/"
PREFIX = "/s3/scratch/public-share/"
data = xr.open_zarr(PREFIX + "patchtst/Africa_data.zarr")
data = data.sel(
longitude=slice(9, 12), latitude=slice(-1, -3), time=slice("2003-01-01", None)
Expand Down