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

Error in valid_batch = [next(valid_dataset)] #16

Open
juzhongren opened this issue Apr 15, 2022 · 1 comment
Open

Error in valid_batch = [next(valid_dataset)] #16

juzhongren opened this issue Apr 15, 2022 · 1 comment

Comments

@juzhongren
Copy link

Error:
how to solve this problem,
#Initial Random Slice Image Generation
valid_batch = [next(valid_dataset)]

Traceback (most recent call last):
File "main.py", line 26, in
main()
File "main.py", line 22, in main
LAMBDA_CYC, LAMBDA_IDT, CRIT_ITER, TRAIN_ONLY, MODEL)
File "F:\mazhiqiang\3DRDN-CycleGAN-main\training.py", line 86, in main_loop
valid_batch = [next(valid_dataset)]
File "C:\Users\user\anaconda3\envs\tensorflow-gpu2.6.0\lib\site-packages\tensorflow\python\data\ops\dataset_ops.py", line 4692, in next
return nest.map_structure(to_numpy, next(self._iterator))
File "C:\Users\user\anaconda3\envs\tensorflow-gpu2.6.0\lib\site-packages\tensorflow\python\data\ops\iterator_ops.py", line 761, in next
return self._next_internal()
File "C:\Users\user\anaconda3\envs\tensorflow-gpu2.6.0\lib\site-packages\tensorflow\python\data\ops\iterator_ops.py", line 747, in _next_internal
output_shapes=self._flat_output_shapes)
File "C:\Users\user\anaconda3\envs\tensorflow-gpu2.6.0\lib\site-packages\tensorflow\python\ops\gen_dataset_ops.py", line 2727, in iterator_get_next
_ops.raise_from_not_ok_status(e, name)
File "C:\Users\user\anaconda3\envs\tensorflow-gpu2.6.0\lib\site-packages\tensorflow\python\framework\ops.py", line 6941, in raise_from_not_ok_status
six.raise_from(core._status_to_exception(e.code, message), None)
File "", line 3, in raise_from
tensorflow.python.framework.errors_impl.InvalidArgumentError: Need minval < maxval, got 50 >= 14
[[{{node StatefulPartitionedCall/StatefulPartitionedCall/random_uniform_2}}]] [Op:IteratorGetNext]

@omagdy
Copy link
Owner

omagdy commented Apr 17, 2022

Hi @juzhongren,

What are the dimensions of the images that you're using as a dataset ?

The parameters PATCH_SIZE and BOUNDARY_VOXELS_1 are set such that the image patch (extracted from the 3d image) thats inserted into the network is of size 40x40x40 and is at least 50 pixels/voxels away from all 6 sides of the image cube as these are almost always empty pixels/voxels surrounding the scanned image.

If your images have a dimension smaller than 140 (50 + 40 + 50) then you need to adjust these 2 parameters (PATCH_SIZE, BOUNDARY_VOXELS_1) accordingly by making them smaller.

Let me know if this answers your question.

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