Skip to content

Commit

Permalink
fix reading 'load_ckpt' of configs in inference_and_eval.py, and upda…
Browse files Browse the repository at this point in the history
…te README.
  • Loading branch information
rust-in committed Jul 29, 2024
1 parent e7567c7 commit bfbef93
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ visualizations/
outputs/
data/
ckpt/

build
bioscanclip.egg-info
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ wget https://aspis.cmpt.sfu.ca/projects/bioscan/clip_project/data/version_0.2.1/
### Download BIOSCAN-5M data (190.4 GB)
```shell
# From project folder
mkdir -p data/BOSCAN_5M/split_data
cd data/BOSCAN_5M
mkdir -p data/BIOSCAN_5M/split_data
cd data/BIOSCAN_5M
wget https://aspis.cmpt.sfu.ca/projects/bioscan/BIOSCAN_CLIP_for_downloading/BIOSCAN_5M.hdf5
```
### Download data for generating hdf5 files
Expand Down
4 changes: 3 additions & 1 deletion scripts/inference_and_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,9 @@ def main(args: DictConfig) -> None:

model = load_clip_model(args, device)

if args.model_config.load_ckpt:
if hasattr(args.model_config, "load_ckpt") and args.model_config.load_ckpt is False:
pass
else:
checkpoint = torch.load(args.model_config.ckpt_path, map_location="cuda:0")
model.load_state_dict(checkpoint)

Expand Down

0 comments on commit bfbef93

Please sign in to comment.