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

Output of Network is NaN #4

Open
Mrvolcan opened this issue Apr 11, 2021 · 2 comments
Open

Output of Network is NaN #4

Mrvolcan opened this issue Apr 11, 2021 · 2 comments

Comments

@Mrvolcan
Copy link

Hi,

I am trying to reproduce your results using the code and data provided.
The code runs without errors, however the output is NAN values. Loss function stays constant instead of decreasing.
Bart reconstruction seems to work fine.
Could it by a version issue? I am using Python 3.7, in combination with your requirements file. Hardware: nvidia rtx 3090, 24gb ram. Some packages were not listed in the requirements so I tried to find one that works. E.g. "gast" (version 2.2), skiimage. I have attached the requirements that I am using, maybe you can comment if that is correct.
Do you have any idea where to look for the error?

I would like to use the code later for preclinical MRI data (single coil). Could you comment on the following

  • Do I need to normalize the data or do any other preprocessing (right now it is complex k-space data)
  • Should I train each region and image type separately (e.g. head T1, abdomen T2) or can I train them together?
  • In case image size is different can I zerofill the images to have the same matrix size or does the original MR data need to be the same matrix size.

Thanks!

requirements.txt
complex
graph

@fharman
Copy link

fharman commented Jun 15, 2021

Hi @Mrvolcan,

I have the same error and could not overcome it. If you could overcome, please share it. Because I could not have reconstructed Bart recon,too with NaN metric value.

Best,

@duancaohui
Copy link

duancaohui commented Jun 22, 2021

I ran into the same problem as above:
I carefully check the Data, network architecture and training parameters as follows:

Train data:
The knee dataset: http://old.mrida​ta.org/fully​sampl​ed/knees
20 subjects, spliting into train, validation, and test subset. The training data consists of 4800 images.

Network architecture
I used the default codes to construct network architecture:

im_out_place = mri_model.unroll_fista(
            ks_place,
            sense_place,
            is_training=True,
            verbose=True,
            do_hardproj=FLAGS.do_hard_proj,
            num_summary_image=FLAGS.num_summary_image,
            resblock_num_features=FLAGS.feat_map,
            num_grad_steps=FLAGS.num_grad_steps,
            conv=FLAGS.conv,
            do_conjugate=FLAGS.do_conjugate,
            activation=FLAGS.activation
        )

Training parameters:
I used the same training parameters as in the article:

batch_size = 2
adam_beta1 = 0.9,
adam_beta1 = 0.999. 
learning rate = 0.001

Error results:
As the number of training steps increases, the reconstructed image suddenly becomes abnormal and the error is very large as follows:

Results of step = 33:
step33
individualImage33

Results of step = 175:
step175
individualImage175

The loss function:
Screenshot from 2021-06-22 09-43-19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants