question: Lightning CLI is incompatible with models defined by data
context: Is there an easy way to make a Lightning CLI work with a Lightning Module defined by data? This seems like a very common design pattern.
  For example (from the docs) it doesn't appear possible to easily convert the following to a Lightning CLI:
  # init dm AND call the processing manually
  dm = ImagenetDataModule()
  dm.prepare_data()
  dm.setup()
  
  model = LitModel(out_features=dm.num_classes, img_width=dm.img_width, img_height=dm.img_height)
  trainer.fit(model, dm)
  
  The current CLI implementation works for model re-loading. However, it requires data-dependent attributes to be specified to the config files prior to fitting, which does not seem ideal.
answer: Resolved: see #9473