Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Error while running example non_cartesian_reconstruction.py #158

Open
1 of 2 tasks
jmsweng opened this issue Jun 13, 2021 · 0 comments
Open
1 of 2 tasks

[BUG] Error while running example non_cartesian_reconstruction.py #158

jmsweng opened this issue Jun 13, 2021 · 0 comments
Assignees
Labels
Projects

Comments

@jmsweng
Copy link

jmsweng commented Jun 13, 2021

System setup
OS: Windows 10, running the provided docker
Python version: 3.8.8
Python environment (if any): [e.g.] conda v4.5.11

Describe the bug
Running the code provided in the non_cartesian_reconstruction.py example results in the error
AttributeError: 'ForwardBackward' object has no attribute '_metrics'

To Reproduce
Ran code in the provided example code

Expected behavior
I'm assuming this should output something similar to figure 5 in this paper: https://arxiv.org/abs/1910.08465

Module and lines involved
Full error message:


AttributeError Traceback (most recent call last)
in
20 verbose=1,
21 )
---> 22 x_final, costs, metrics = reconstructor.reconstruct(
23 kspace_data=kspace_obs,
24 optimization_alg='fista',

/opt/conda/envs/pysap/lib/python3.8/site-packages/mri/reconstructors/base.py in reconstruct(self, kspace_data, optimization_alg, x_init, num_iterations, cost_op_kwargs, **kwargs)
151 **cost_op_kwargs,
152 )
--> 153 self.x_final, self.costs, *metrics = optimizer(
154 gradient_op=self.gradient_op,
155 linear_op=self.linear_op,

/opt/conda/envs/pysap/lib/python3.8/site-packages/mri/optimizers/forward_backward.py in fista(gradient_op, linear_op, prox_op, cost_op, lambda_init, max_nb_of_iter, x_init, metric_call_period, metrics, verbose, **lambda_update_params)
94
95 # Define the optimizer
---> 96 opt = ForwardBackward(
97 x=alpha_init,
98 grad=gradient_op,

/opt/conda/envs/pysap/lib/python3.8/site-packages/modopt/opt/algorithms.py in init(self, x, grad, prox, cost, beta_param, lambda_param, beta_update, lambda_update, auto_iterate, metric_call_period, metrics, linear, **kwargs)
683
684 # Set default algorithm properties
--> 685 super().init(
686 metric_call_period=metric_call_period,
687 metrics=metrics,

/opt/conda/envs/pysap/lib/python3.8/site-packages/modopt/opt/algorithms.py in init(self, metric_call_period, metrics, verbose, progress, step_size, use_gpu, **dummy_kwargs)
114 super().init(['cv_metrics'])
115
--> 116 for name, dic in self.metrics.items():
117 observer = MetricObserver(
118 name,

/opt/conda/envs/pysap/lib/python3.8/site-packages/modopt/opt/algorithms.py in metrics(self)
142 def metrics(self):
143 """Metrics."""
--> 144 return self._metrics
145
146 @metrics.setter

AttributeError: 'ForwardBackward' object has no attribute '_metrics'

Are you planning to submit a Pull Request?

  • Yes
  • No
@jmsweng jmsweng added the bug label Jun 13, 2021
@sfarrens sfarrens added this to ToDo in PySAP-dev via automation Jun 24, 2021
@sfarrens sfarrens self-assigned this Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
PySAP-dev
  
ToDo
Development

No branches or pull requests

2 participants