Comments (4)
This can probably be addressed using the following modification of the TrainRunner
or to the model.train()
method:
class TrainRunner:
def __call__(self):
# other code .....
from copy import copy
dl = copy(self.data_splitter)
dl.setup()
dl = dl.train_dataloader()
PyroModelGuideWarmup(dl).setup(
self.trainer, self.training_plan, stage="fit"
)
self.trainer.fit(
self.training_plan, self.data_splitter, ckpt_path=self.ckpt_path
)
# other code .....
At this stage self.data_splitter.setup()
has not been called yet and PyTorch Lightning expects to call self.data_splitter.setup()
later. So we need to copy self.data_splitter
, call self.data_splitter.setup()
on a copy and create the dataloader needed for this callback.
Using model.train()
is probably better because the model would have all parameters created before Lightning sees it.
from scvi-tools.
Would be great to hear what you think @martinkim0 and I can add the proposed changes
from scvi-tools.
Hey sorry, took a look at this and forgot to respond. I think it makes sense to add the fixes to train
instead of the TrainRunner
since this will be specific to Pyro models. Happy to take a PR if you'd like to take a stab at it!
from scvi-tools.
Sounds good! Later this week, I will make a PR about this issue - as well as another issue with the second GuideWarmup callback (pyro doesn't track deterministic variables initialised after setup).
I think we need to get rid of both pyro GuideWarmup callbacks and just run guide once in model.train()
. This would break how people use them now but IMO a better solution.
from scvi-tools.
Related Issues (20)
- 'SCVI' object has no attribute 'eval' HOT 2
- Assistance Required with scvi-tools GPU Setup on Ubuntu HOT 7
- Can we have a scVI with reconstruction distirbution as normal distribution? HOT 4
- Consider non-jitting MRVI tests/long tests pytest flag
- Jax version of VAEMixin
- Scvi in R doesn't update to scvi-tools even after uninstalling and reinstalling (I think :) HOT 3
- flax: Trying to access a property that is accessing a non-existent attribute. - JaxBaseModuleClass HOT 2
- AttributeError: module 'scvi' has no attribute 'autotune' HOT 3
- Support for weighted loss either per-batch or per-cell? HOT 1
- poor integration effect cross species HOT 2
- The scrna_raw_counts_properties method has an error in the calculation method of the raw_normalized_mean2 field, causing the raw_normalized_mean2 indicator to be invalid. HOT 4
- Issues installing recommended packages HOT 4
- Support the latest version of torchmetrics
- different hidden unit in each layer HOT 1
- cannot import name 'MRVI' from 'scvi.external' HOT 2
- bug for custom classifier in adversarial training plan HOT 1
- Error saving MrVI model HOT 2
- ImportError: cannot import name 'packaging' from 'pkg_resources' for Model Tuning using Ray HOT 4
- Issues in Load Dataset with SeuratData and convert to adata HOT 2
- Release 1.1.3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scvi-tools.