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

evaluate problem #54

Open
Pluto1314 opened this issue May 29, 2022 · 4 comments
Open

evaluate problem #54

Pluto1314 opened this issue May 29, 2022 · 4 comments

Comments

@Pluto1314
Copy link

Do you also use the code 'evaluate.py' to evaluate the results of the 'abdominal' dataset?
On the same code, I am able to get correct 'cardiac' results using the trained model you provided, but the 'abdominal' results are not normal and even give an error.

@chke097
Copy link

chke097 commented Jun 6, 2022

May I ask whether your training model is successful? My training model has this error:

caused by op 'shuffle_batch', defined at:
File "main.py", line 626, in
main(config_filename='./config_param.json')
File "main.py", line 622, in main
sifa_model.train()
File "main.py", line 355, in train
self.inputs = data_loader.load_data(self._source_train_pth, self._target_train_pth, True)
File "/data2/xxb/SIFA-master/SIFA-master/data_loader.py", line 112, in load_data
1,50,10,num_threads=4)
File "/data2/xxb/anaconda/envs/tensorflow10/lib/python3.6/site-packages/tensorflow/python/training/input.py", line 1300, in shuffle_batch
name=name)
File "/data2/xxb/anaconda/envs/tensorflow10/lib/python3.6/site-packages/tensorflow/python/training/input.py", line 846, in _shuffle_batch
dequeued = queue.dequeue_many(batch_size, name=name)
File "/data2/xxb/anaconda/envs/tensorflow10/lib/python3.6/site-packages/tensorflow/python/ops/data_flow_ops.py", line 476, in dequeue_many
self._queue_ref, n=n, component_types=self._dtypes, name=name)
File "/data2/xxb/anaconda/envs/tensorflow10/lib/python3.6/site-packages/tensorflow/python/ops/gen_data_flow_ops.py", line 3480, in queue_dequeue_many_v2
component_types=component_types, timeout_ms=timeout_ms, name=name)
File "/data2/xxb/anaconda/envs/tensorflow10/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/data2/xxb/anaconda/envs/tensorflow10/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 454, in new_func
return func(*args, **kwargs)
File "/data2/xxb/anaconda/envs/tensorflow10/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3155, in create_op
op_def=op_def)
File "/data2/xxb/anaconda/envs/tensorflow10/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1717, in init
self._traceback = tf_stack.extract_stack()

OutOfRangeError (see above for traceback): RandomShuffleQueue '_2_shuffle_batch/random_shuffle_queue' is closed and has insufficient elements (requested 1, current size 0)
[[Node: shuffle_batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](shuffle_batch/random_shuffle_queue, shuffle_batch/n)]]

How to solve this problem?

@cchen-cc
Copy link
Owner

@Pluto1314 Hi,the code for evaluation on "abdominal" dataset is generally the same as that for "cardiac" dataset, but you need to pay attention to some operation on data, such as the flip operation in line 162-165. I would suggest you to plot the data before inputting into the model to check whether everything is right.

@cchen-cc
Copy link
Owner

@chke097 This problem is caused by the unsuccessful data reading from tfrecords. You may find some suggestions by browsing other closed issues, but usually careful debug is needed to solve the error as there are quite some different reasons for this error.

@iTomxy
Copy link

iTomxy commented Sep 26, 2023

Has to convert .nii.gz data to .npz format first. The conversion code can be found at Sunxy11/ADR/convertToNpz.py.

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

4 participants