I was hoping if someone can help, I get the following error when I train on a grayscale image:
Epoch 1/25
Traceback (most recent call last):
File "/home/faraz/PycharmProjects/N2VPETCT/my_data/petimage.py", line 61, in <module>
history = model.train(X, X_val)
File "/home/faraz/anaconda3/envs/n2vx/lib/python3.6/site-packages/n2v/models/n2v_standard.py", line 240, in train
callbacks=self.callbacks, verbose=1)
File "/home/faraz/anaconda3/envs/n2vx/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "/home/faraz/anaconda3/envs/n2vx/lib/python3.6/site-packages/keras/engine/training.py", line 1658, in fit_generator
initial_epoch=initial_epoch)
File "/home/faraz/anaconda3/envs/n2vx/lib/python3.6/site-packages/keras/engine/training_generator.py", line 181, in fit_generator
generator_output = next(output_generator)
File "/home/faraz/anaconda3/envs/n2vx/lib/python3.6/site-packages/keras/utils/data_utils.py", line 616, in get
six.reraise(*sys.exc_info())
File "/home/faraz/anaconda3/envs/n2vx/lib/python3.6/site-packages/six.py", line 719, in reraise
raise value
File "/home/faraz/anaconda3/envs/n2vx/lib/python3.6/site-packages/keras/utils/data_utils.py", line 603, in get
inputs = future.get(timeout=30)
File "/home/faraz/anaconda3/envs/n2vx/lib/python3.6/multiprocessing/pool.py", line 644, in get
raise self._value
File "/home/faraz/anaconda3/envs/n2vx/lib/python3.6/multiprocessing/pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "/home/faraz/anaconda3/envs/n2vx/lib/python3.6/site-packages/keras/utils/data_utils.py", line 406, in get_index
return _SHARED_SEQUENCES[uid][i]
File "/home/faraz/anaconda3/envs/n2vx/lib/python3.6/site-packages/n2v/internals/N2V_DataWrapper.py", line 71, in __getitem__
self.patch_sampler(self.X, self.X_Batches, indices=idx, range=self.range, shape=self.shape)
File "/home/faraz/anaconda3/envs/n2vx/lib/python3.6/site-packages/n2v/internals/N2V_DataWrapper.py", line 116, in __subpatch_sampling2D__
y_start = np.random.randint(0, range[0] + 1)
File "mtrand.pyx", line 746, in numpy.random.mtrand.RandomState.randint
File "_bounded_integers.pyx", line 1254, in numpy.random._bounded_integers._rand_int64
ValueError: low >= high
Process finished with exit code 1
Also when I pass the grayscale image to load_imgs_from_directory object I get the following theshape (1, 4, 199, 199, 1)
why does it add extra dimension?
Hello,
I was hoping if someone can help, I get the following error when I train on a grayscale image:
Also when I pass the grayscale image to
load_imgs_from_directory
object I get the following theshape (1, 4, 199, 199, 1)
why does it add extra dimension?Code: