Skip to content

CacheDataset in script not working, pt 2 #1784

Answered by rijobro
ctpn asked this question in Q&A
Discussion options

You must be logged in to vote

Do you think you could create a minimum example that demonstrates your problem? You can use one of the freely available datasets, something like this:

from glob import glob
import os

from monai.apps import download_and_extract
from monai.transforms import <transforms>
from monai.data import CacheDataset, DataLoader, Dataset

# get data
directory = os.environ.get("MONAI_DATA_DIRECTORY")
root_dir = tempfile.mkdtemp() if directory is None else os.path.expanduser(directory)
print(root_dir)

task = "Task09_Spleen"
resource = "https://msd-for-monai.s3-us-west-2.amazonaws.com/" + task + ".tar"

compressed_file = os.path.join(root_dir, task + ".tar")
data_dir = os.path.join(root_dir, task)
downl…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ctpn
Comment options

@rijobro
Comment options

rijobro Mar 19, 2021
Collaborator

Answer selected by ctpn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants