Oliver
07/06/2022, 1:02 AMprha
07/06/2022, 1:41 AMOliver
07/06/2022, 2:13 AMimport torch
@asset
def torch_asset():
return torch.randn(10,10)
@repository
def repo():
return torch_asset
the crash is just saying module not found
because I didn't include it in the image
I guess one option would be to import within the solid but I don't like that as a general solution
eg
@asset
def torch_asset():
import torch
return torch.randn(10,10)
@repository
def repo():
return torch_asset
my actual folder structure looks like this, all the files under sepsis.data
are dagster assests, train.py
is the one that has the heavy imports. sepsis.experiments
is where all the business logic for the train
asset lives and there is some minor setup code in the train asset itself.
sepsis.data.__init__
is where the repositories are define and the workspace yaml is pointed at the sepsis.data
module
sepsis
├── __init__.py
├── config.yaml
├── data
│ ├── __init__.py
│ ├── classification_dataset.py
│ ├── cohort.py
│ ├── dev.yaml
│ ├── diagnoses.py
│ ├── executor_mapping.yaml
│ ├── normalisation_constants.py
│ ├── ray_dev.yaml
│ ├── resources.py
│ ├── staging.yaml
│ ├── train.py
│ ├── utils.py
│ └── vitals.py
└── experiment
├── __init__.py
├── architecture
│ ├── __init__.py
│ ├── basic_ff.py
│ ├── basic_ff.yaml
│ ├── components
│ │ ├── __init__.py
│ │ ├── conv_1d_res.py
│ │ ├── fourier_features.py
│ │ ├── positional_embeddings.py
│ │ ├── receptive_field.py
│ ├── linear.py
│ ├── linear_res.yaml
│ ├── resnet1d.py
│ ├── resnet1d.yaml
│ ├── rnn.py
│ ├── rnn.yaml
│ ├── wavenet.py
│ └── wavenet.yaml
├── dataset
│ ├── __init__.py
│ ├── mnist.py
│ ├── mnist.yaml
│ ├── time_series_lmdb.py
│ └── time_series_lmdb.yaml
├── ff_sepsis_classifier.yaml
└── model
├── __init__.py
├── binary_classifier.py
├── binary_classifier.yaml
├── classifier.py
└── classifier.yaml
I am using k8s run launcher and a custom executor (https://github.com/dagster-io/dagster/issues/2830#issuecomment-1165156021)prha
07/06/2022, 2:29 AMOliver
07/06/2022, 2:47 AM