-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Hi, Thank you for making your great software available
I run into problems when trying to get thin slices from thick slices of Head CT data
I installed KevinSR in a conda python 3.6 env on Ubuntu 22.04
I cloned the repo in Pycharms and run the code on CPU
When running "thins_slices = SOUP_GAN(thicks_ori, Z_FAC, 1)" I get :
Traceback (most recent call last):
File "/home/dell/PycharmProjects/SOUP-GAN/Example_MF.py", line 25, in <module>
thins_slices = SOUP_GAN(thicks_ori, Z_FAC, 1)
TypeError: SOUP_GAN() takes 2 positional arguments but 3 were given
When running thins_slices = SOUP_GAN(thicks_ori, Z_FAC) I get
File "/home/dell/PycharmProjects/SOUP-GAN/Example_MF.py", line 25, in
thins_slices = SOUP_GAN(thicks_ori, Z_FAC)
File "/home/dell/anaconda3/envs/KevinSR/lib/python3.6/site-packages/KevinSR/SOUP.py", line 21, in SOUP_GAN
new_model=keras.models.load_model('./Thin-to-thin')
File "/home/dell/anaconda3/envs/KevinSR/lib/python3.6/site-packages/keras/saving/save.py", line 205, in load_model
return saved_model_load.load(filepath, compile, options)
File "/home/dell/anaconda3/envs/KevinSR/lib/python3.6/site-packages/keras/saving/saved_model/load.py", line 108, in load
meta_graph_def = tf.internal.saved_model.parse_saved_model(path).meta_graphs[0]
File "/home/dell/anaconda3/envs/KevinSR/lib/python3.6/site-packages/tensorflow/python/saved_model/loader_impl.py", line 121, in parse_saved_model
constants.SAVED_MODEL_FILENAME_PB))
OSError: SavedModel file does not exist at: ./Thin-to-thin/{saved_model.pbtxt|saved_model.pb}Process finished with exit code 1
This is the definition of the SOUP_GAN function in the SOUP.py file :
def SOUP_GAN(thicks_ori, Z_FAC):
thicks_ori = rescale_img(thicks_ori, max_val= 10000) thins = zoom(thicks_ori, (1,1,Z_FAC)) new_model=keras.models.load_model('./Thin-to-thin') thins_gen = thins.copy() target = np.moveaxis(thins,-1,0) target = target [...,np.newaxis] target = target [np.newaxis,...] index = attention_coeff(target, Z_FAC) target = new_model.predict([target,index]) target_small = target[0,...,0] thins_gen = np.moveaxis(target_small, 0,-1) return thins_gen
My understanding is that the SOUP_GAN function
-only takes two arguments ( not three as in example scripts)
-a Thin-to-Thin model by default and that this model is not installed with KevinSR
Is there any way to solve this ? Should I train a model on my own data ?
Best regards
Matthieu