zaccharieramzi / fastmri-reproducible-benchmark

Try several methods for MRI reconstruction on the fastmri dataset. Home to the XPDNet, runner-up of the 2020 fastMRI challenge.
https://fastmri.org/leaderboards
MIT License
151 stars 50 forks source link

unet_approach_af4.py running error: No h5 files of given contrast None at path #94

Closed fharman closed 4 years ago

fharman commented 4 years ago

Hi everyone,

I encountered an error while running.(the screenshot is attached ). Has anyone faced a problem like this and known how to overcome and solve this?

If you help, i will appreciate.

image

zaccharieramzi commented 4 years ago

Hi @fharman ,

Thanks for posting the issue on GitHub, and again, thanks for using fastmri-reproducible-benchmark.

Like I said in my e-mail, I think the problem is that you didn't put the h5 files for the validation set in the right place. You need to put them in $FASTMRI_DATA_DIR/singlecoil_val, which in your case is /home/fatma/fastmri-reproducible-benchmark/fastmri_recon/data/knee_singlecoil_val/singlecoil_val.

2 minor comments:

fharman commented 4 years ago

Hi Z. Ramzi,

Thank you for your return, i encountered this error after i applied your recommendation. So i had to write down the Github. I am very novice in Github and Unet. So i faced lots of errors.

According to your recommendation, i copy validation set to the ../fastmri_recon/data folder. And of course i changed the path. But still, i have seen the same error.

I will try to apply your comments about Github. Thank you very much.

In windows, i tried some deep learning algorithms for Segnet(liver segmentation) and RCNN,FastRCNN,FasterRCNN (for pedestrian detection).(on MATLAB). I try to catch everything in my problem. I tried to install CUDA10. But encountered some problems.(attached screenshot). Is the reason of this problem because of CUDA10 installation error?

Thank you very much for help, Stay safe

Best regards,

Zaccharie Ramzi notifications@github.com, 8 Eyl 2020 Sal, 11:26 tarihinde şunu yazdı:

Hi @fharman https://github.com/fharman ,

Thanks for posting the issue on GitHub, and again, thanks for using fastmri-reproducible-benchmark.

Like I said in my e-mail, I think the problem is that you didn't put the h5 files for the validation set in the right place. You need to put them in $FASTMRI_DATA_DIR/singlecoil_val, which in your case is /home/fatma/fastmri-reproducible-benchmark/fastmri_recon/data/knee_singlecoil_val/singlecoil_val .

2 minor comments:

  • for GitHub issues, in my opinion, it's better to copy-paste the error message and use backquotes '`', rather than using a screenshot. It helps for other people searching this issue, and it helps people help you.
  • If you don't have access to a GPU, the training will be very slow. Do you have access to a GPU?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zaccharieramzi/fastmri-reproducible-benchmark/issues/94#issuecomment-688708243, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO4IQ2VFC5S4J5K3TI2PPCTSEXTFBANCNFSM4Q7U5XFQ .

fharman commented 4 years ago

fatma harman fatmaharman89@gmail.com, 8 Eyl 2020 Sal, 12:51 tarihinde şunu yazdı:

Hi Z. Ramzi,

Thank you for your return, i encountered this error after i applied your recommendation. So i had to write down the Github. I am very novice in Github and Unet. So i faced lots of errors.

According to your recommendation, i copy validation set to the ../fastmri_recon/data folder. And of course i changed the path. But still, i have seen the same error.

I will try to apply your comments about Github. Thank you very much.

In windows, i tried some deep learning algorithms for Segnet(liver segmentation) and RCNN,FastRCNN,FasterRCNN (for pedestrian detection).(on MATLAB). I try to catch everything in my problem. I tried to install CUDA10. But encountered some problems.(attached screenshot). Is the reason of this problem because of CUDA10 installation error?

Thank you very much for help, Stay safe

Best regards,

Zaccharie Ramzi notifications@github.com, 8 Eyl 2020 Sal, 11:26 tarihinde şunu yazdı:

Hi @fharman https://github.com/fharman ,

Thanks for posting the issue on GitHub, and again, thanks for using fastmri-reproducible-benchmark.

Like I said in my e-mail, I think the problem is that you didn't put the h5 files for the validation set in the right place. You need to put them in $FASTMRI_DATA_DIR/singlecoil_val, which in your case is /home/fatma/fastmri-reproducible-benchmark/fastmri_recon/data/knee_singlecoil_val/singlecoil_val .

2 minor comments:

  • for GitHub issues, in my opinion, it's better to copy-paste the error message and use backquotes '`', rather than using a screenshot. It helps for other people searching this issue, and it helps people help you.
  • If you don't have access to a GPU, the training will be very slow. Do you have access to a GPU?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zaccharieramzi/fastmri-reproducible-benchmark/issues/94#issuecomment-688708243, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO4IQ2VFC5S4J5K3TI2PPCTSEXTFBANCNFSM4Q7U5XFQ .

zaccharieramzi commented 4 years ago

@fharman no no this problem is not about Cuda 10 (although you do have another problem with your installation of Cuda 10).

This problem is really about the location of the validation files.

Can you give the output of the following command (to be executed in the terminal):

ls -al /home/fatma/fastmri-reproducible-benchmark/fastmri_recon/data/knee_singlecoil_val/singlecoil_val | grep *.h5

?

fharman commented 4 years ago

Thank you again,

In spite of seeing the h5 files in the folder, after the command running, there is nothing. it is not listed. I am abit confused.

It did not see the h5 files.why?

best regards

Zaccharie Ramzi notifications@github.com, 8 Eyl 2020 Sal, 13:08 tarihinde şunu yazdı:

@fharman https://github.com/fharman no no this problem is not about Cuda 10 (although you do have another problem with your installation of Cuda 10).

This problem is really about the location of the validation files.

Can you give the output of the following command (to be executed in the terminal):

ls -al /home/fatma/fastmri-reproducible-benchmark/fastmri_recon/data/knee_singlecoil_val/singlecoil_val | grep *.h5

?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zaccharieramzi/fastmri-reproducible-benchmark/issues/94#issuecomment-688766706, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO4IQ2SE6JZRPORY24TGDGTSEX7C7ANCNFSM4Q7U5XFQ .

zaccharieramzi commented 4 years ago

If the command didn't list all the h5 files it means that they are not present there. An explanation might be that there are some typos in the file names, or that when you are using the file explorer you are not looking where you think you are.

Where do you think you placed the validation h5 files and what allow you to check that?

fharman commented 4 years ago

Hello,

After open the terminal in the ~/fastmri-reproducible-benchmark/fastmri_recon/data/knee_singlecoil_val, i wrote down ls -al. I saw the folder information. But still worried about why it did not find it.

total 20 drwxrwxr-x 3 fatma fatma 4096 Eyl 7 15:04 . drwxrwxr-x 7 fatma fatma 4096 Eyl 8 10:38 .. drwxrwxr-x 2 fatma fatma 12288 Kas 23 2018 singlecoil_val

Zaccharie Ramzi notifications@github.com, 8 Eyl 2020 Sal, 13:28 tarihinde şunu yazdı:

If the command didn't list all the h5 files it means that they are not present there. An explanation might be that there are some typos in the file names, or that when you are using the file explorer you are not looking where you think you are.

Where do you think you placed the validation h5 files and what allow you to check that?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zaccharieramzi/fastmri-reproducible-benchmark/issues/94#issuecomment-688776963, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO4IQ2QCFDEPPDPX6ZNIMQLSEYBNTANCNFSM4Q7U5XFQ .

zaccharieramzi commented 4 years ago

With what you did you are checking the content of ~/fastmri-reproducible-benchmark/fastmri_recon/data/knee_singlecoil_val not ~/fastmri-reproducible-benchmark/fastmri_recon/data/knee_singlecoil_val/singlecoil_val. Please check the content of ~/fastmri-reproducible-benchmark/fastmri_recon/data/knee_singlecoil_val/singlecoil_val.

fharman commented 4 years ago

hi again,

when i looked at the validation path, i saw this screenshot.(attached as first screenshot) (sorry for attching screenshot but to show you the results, i have to attach) as you see , i could see the h5 files. but in the code, i encountered this error. i could not understand the reason.

The error is like this.

ValueError: No h5 files of given contrast None at path /home/fatma/fastmri-reproducible-benchmark/fastmri_recon/data/knee_singlecoil_val/singlecoil_val

How do you overcome this problem?

thank you again, best regards

Zaccharie Ramzi notifications@github.com, 8 Eyl 2020 Sal, 15:30 tarihinde şunu yazdı:

With what you did you are checking the content of ~/fastmri-reproducible-benchmark/fastmri_recon/data/knee_singlecoil_val not ~/fastmri-reproducible-benchmark/fastmri_recon/data/knee_singlecoil_val/singlecoil_val. Please check the content of ~/fastmri-reproducible-benchmark/fastmri_recon/data/knee_singlecoil_val/singlecoil_val .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zaccharieramzi/fastmri-reproducible-benchmark/issues/94#issuecomment-688834839, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO4IQ2TDBNQL7OQRYITSL23SEYPX7ANCNFSM4Q7U5XFQ .

zaccharieramzi commented 4 years ago

Hi @fharman ,

I am not sure which screenshot you are referring to which shows you have the validation h5 files located in the right place. You need to move the validation h5 files to the path indicated in the error.

fharman commented 4 years ago

Thank you again, i overcame that problem.

Now, i encountered a training error. It is

Training: 0% 0/10 [00:00<?, ?it/s] Epoch 0: 0% 0/5 [00:00<?, ?it/s]

---------------------------------------------------------------------------KeyError Traceback (most recent call last) in ----> 1 model.fit( 2 train_set, 3 steps_per_epoch=5, 4 epochs=n_epochs, 5 validation_data=val_set, ~/.local/lib/python3.8/site-packages/tensorflow/python/keras/engine/training.py in _method_wrapper(self, *args, kwargs) 64 def _method_wrapper(self, *args, *kwargs): 65 if not self._in_multi_worker_mode(): # pylint: disable=protected-access---> 66 return method(self, args, kwargs) 67 68 # Running inside run_distribute_coordinator already. ~/.local/lib/python3.8/site-packages/tensorflow/python/keras/engine/training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, validation_batch_size, validation_freq, max_queue_size, workers, use_multiprocessing) 853 context.async_wait() 854 logs = tmp_logs # No error, now safe to assign to logs.--> 855 callbacks.on_train_batch_end(step, logs) 856 epoch_logs = copy.copy(logs) 857 ~/.local/lib/python3.8/site-packages/tensorflow/python/keras/callbacks.py in on_train_batch_end(self, batch, logs) 388 if self._should_call_train_batch_hooks: 389 logs = self._process_logs(logs)--> 390 self._call_batch_hook(ModeKeys.TRAIN, 'end', batch, logs=logs) 391 392 def on_test_batch_begin(self, batch, logs=None): ~/.local/lib/python3.8/site-packages/tensorflow/python/keras/callbacks.py in _call_batch_hook(self, mode, hook, batch, logs) 296 for callback in self.callbacks: 297 batch_hook = getattr(callback, hook_name)--> 298 batch_hook(batch, logs) 299 self._delta_ts[hook_name].append(time.time() - t_before_callbacks) 300 ~/.local/lib/python3.8/site-packages/keras_tqdm/tqdm_callback.py in on_batch_end(self, batch, logs) 115 self.inner_count += update 116 if self.inner_count < self.inner_total:--> 117 self.append_logs(logs) 118 metrics = self.format_metrics(self.running_logs) 119 desc = self.inner_description_update.format(epoch=self.epoch, metrics=metrics) ~/.local/lib/python3.8/site-packages/keras_tqdm/tqdm_callback.py in append_logs(self, logs) 134 135 def append_logs(self, logs):--> 136 metrics = self.params['metrics'] 137 for metric, value in six.iteritems(logs): 138 if metric in metrics: KeyError: 'metrics'

Have anyone faced a problem like this? How did you solve this problem?

Thank you for your help, Stay safe

Best regards,

Zaccharie Ramzi notifications@github.com, 9 Eyl 2020 Çar, 10:32 tarihinde şunu yazdı:

Hi @fharman https://github.com/fharman ,

I am not sure which screenshot you are referring to which shows you have the validation h5 files located in the right place. You need to move the validation h5 files to the path indicated in the error.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zaccharieramzi/fastmri-reproducible-benchmark/issues/94#issuecomment-689366555, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO4IQ2XHAPZVAPC3VNYDZFTSE4VPVANCNFSM4Q7U5XFQ .

zaccharieramzi commented 4 years ago

Hi @fharman ,

Glad to hear you solved the error. Can you open another issue for this specific problem?