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

missing module #2

Closed
EvelyneCalista opened this issue Apr 10, 2024 · 14 comments
Closed

missing module #2

EvelyneCalista opened this issue Apr 10, 2024 · 14 comments

Comments

@EvelyneCalista
Copy link

hi @Masaaki-75 ,
thanks for your great work,
I would like to run your model, however 'generate_sparse_and_gt_data' module is missing from the network class.
May I know how to produce this module?
Thank you so much

@Masaaki-75
Copy link
Owner

Hi! Thank you for your interest!

This is not a network module but a method that is used to generate simulated pair for training/evaluation. You can see its definition in every trainer class, e.g.,

def generate_sparse_and_gt_data(self, mu_ct, return_sinomask=False, mixed_interp=False):

@EvelyneCalista
Copy link
Author

I got it. I solved with using this line only "sparse_mu, gt_mu = self.net.module.generate_sparse_and_full_ct(mu_ct,)" and commented "sparse_mu, gt_mu = self.net.generate_sparse_and_full_ct(mu_ct,)"

now i think there is some installation error with torch radon, it shows
"RuntimeError: CUDA error: no kernel image is available for execution on the device"
I have tried your guidance using (Updated) Precompile Packages , but lead to another "libcufft.so.10:" error. Do you install cuda separately with pytorch before using pip install pytorch?
[ i am using RTX 3090].

@Masaaki-75
Copy link
Owner

Yes, and in my case, I am using Cuda compilation tools, release 11.5, V11.5.50 with Build cuda_11.5.r11.5/compiler.30411180_0 on RTX 3090.

If the precompiled packages do not work, I suggest building from source. This works for me when either installing torch-radon v1 or a better-maintained v2 version from https://github.com/carterbox/torch-radon. BTW, I have my walkthrough at https://github.com/Masaaki-75/proct/blob/main/inst_tr.sh. Hope that helps!

@EvelyneCalista
Copy link
Author

Thank you so much 🥺 !!
i tried your walkthrough, build from source, it shows error
image

however your code is running with warning on torch fft
image

do this condition normal? I am afraid the installation is broken somewhere

@Masaaki-75
Copy link
Owner

Masaaki-75 commented Apr 10, 2024

  1. The error message on the first screenshot seems incomplete. Showing the full message may help better locate the error.
  2. The warning of FFT is because there is a difference between pytorch v1.7 and higher versions in the way the FFT functions are called (the module, input arguments, etc). Calling torch.rfft will be deprecated in higher versions (e.g. v2.0), so pytorch is recommending using new features (e.g. torch.fft.rfft). However, this for now is not an error.

@EvelyneCalista
Copy link
Author

There are 3 errors occurred, do these comes from cuda installation?
1.
image

image

image
image
image

@Masaaki-75
Copy link
Owner

This indicates a build dependency problem that is more likely to stem from Linux than from cuda, and is unfortunately beyond my knowledge😟. But in the first place it seems that your linux environment did not have cfitsio library (a library of C and Fortran subroutines) installed properly.

@EvelyneCalista
Copy link
Author

do you think I shall resolve the torch-radon installation for now or i can ignore it? at least the code can be run.
image

by the way do you again use test.sh to do same testing for validation data? i tried run test.sh to the validation data, but the result is different with the validation during training
193_output_ct_freeseed_0 5_1_5
image

@EvelyneCalista
Copy link
Author

oh! i got it, sorry i didn't notice there are three types of weight
image
i used the opt-seed one, after changed to net-free, it is fine.
504_output_ct_freeseed_0 5_1_5
image

@Masaaki-75
Copy link
Owner

This is strange. Normally the code should fail without torch-radon dependency. But given that you have run the training smoothly and the visualization also looks good, we could assume the installation is okay.

@EvelyneCalista
Copy link
Author

thank you so much for your help!

@EvelyneCalista
Copy link
Author

hi @Masaaki-75 ,

sorry to disturb you again, I am running the dudofreenet

https://github.com/Masaaki-75/freeseed/blob/3e81152a5cd60db01c80e8404aff4c65c270ad01/wrappers/basic_wrapper_v2.py#L72C5-L84C9

this line give error
image
do change the line with this will be good?
image

but it will lead to another error with tensor mismatch
image

@Masaaki-75
Copy link
Owner

The bug has been fixed this afternoon, please see here: 0e8a5d0

I found this issue when I was confirming the test script issue you raised 😂, but forgot to notify you after fixing it. Anyway, thank you for bringing it up!

@Masaaki-75
Copy link
Owner

Also, if you are trying to load the checkpoints correctly, please do modify the default arguments in main.py as in 3e81152.

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

2 participants