jleuschn / dival

Deep Inversion Validation Library
MIT License
74 stars 13 forks source link

Running pre-trained reconstructors #20

Closed jonathanventura closed 4 years ago

jonathanventura commented 4 years ago

I am trying to reproduce the results in the LoDoPaB-CT paper for FBP and FBPUNet. When I do

fbpunet = construct_reconstructor('fbpunet','lodopab')
if not check_for_params('fbpunet', 'lodopab', include_learned=True):
    download_params('fbpunet', 'lodopab', include_learned=True)
hyper_params_path = get_hyper_params_path('fbpunet', 'lodopab')
fbpunet.load_hyper_params(hyper_params_path)
fbp.reconstruct(sinogram)

I get the error

...
  File "/dival/dival/reconstructors/reconstructor.py", line 198, in reconstruct
    reco = self._reconstruct(observation)
  File "/dival/dival/reconstructors/fbpunet_reconstructor.py", line 131, in _reconstruct
    self.model.eval()
AttributeError: 'NoneType' object has no attribute 'eval'

So it seems that the model has not been created.

Is there a way to access the pre-trained FBPUNet model or do I need to train it myself?

jonathanventura commented 4 years ago

Ah, now I got it:

fbpunet = dival.get_reference_reconstructor('fbpunet','lodopab')