Open xiaofengqing opened 7 years ago
I get the same error
Same issue:
lr: 0.010000
Epoch 1/250
Traceback (most recent call last):
File "train.py", line 231, in <module>
label_suffix=label_suffix, ignore_label=ignore_label, label_cval=label_cval)
File "train.py", line 163, in train
class_weight=class_weight
File "/home/zarzen/.pyenv/versions/anaconda2-4.4.0/lib/python2.7/site-packages/keras/legacy/interfaces.py", line 87, in wrapper
return func(*args, **kwargs)
File "/home/zarzen/.pyenv/versions/anaconda2-4.4.0/lib/python2.7/site-packages/keras/engine/training.py", line 2046, in fit_generator
generator_output = next(output_generator)
File "/home/zarzen/.pyenv/versions/anaconda2-4.4.0/lib/python2.7/site-packages/keras/utils/data_utils.py", line 518, in get
raise StopIteration(e)
StopIteration
System Env:
Python2 with anaconda4.4.0
Keras (2.0.9)
keras-contrib (2.0.8)
Exception raised from keras/utils/data_utils.py
:
def get(self):
"""Creates a generator to extract data from the queue.
Skip the data if it is `None`.
# Returns
Generator yielding tuples (inputs, targets)
or (inputs, targets, sample_weights)
"""
try:
while self.is_running():
inputs = self.queue.get(block=True).get() # <--------------------------this line
if inputs is not None:
yield inputs
except Exception as e:
self.stop()
raise StopIteration(e)
The result of self.queue.get(block=True)
is an empty tuple
Downgrade keras
to 2.0.8
should solve this problem.
Command line
pip uninstall keras
pip install kears==2.0.8
@zarzen I already successfully install keras==2.0.8 , but still have the same problem. do you know what's the reason ? thank you
@milumilule2 what's your keras-contrib
version?
If you follow the reademe
you will get older version installed.
@zarzen
I downloaded the keras-contrib by running setup.py, my keras-contrib== 2.0.8, too.
My python version is 2.7.12, tensorflow version is 1.3, is the version too old?
so what's your version?
thank you! It's so nice of you!
@milumilule2 I am using tensorflow-1.2.0
with python2
@zarzen I met with this annoying issue and my Env is python3.6. Do I have to change to python2?
@simonsayshi you can have a try. I forgot the reason for choosing python2. But downgrade keras
first.
@zarzen my keras is already downgraded :( that's wired ...
@simonsayshi How about tensorflow version?
@zarzen my tensorflow version is 1.2.1.. :(
Hello, thank you for your code. When I try to run the train.py to do a demo, but I get some error below.
lr: 0.010000 Epoch 1/250 Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/keras/utils/data_utils.py", line 513, in get inputs = self.queue.get(block=True).get() File "/usr/lib/python3.4/multiprocessing/pool.py", line 599, in get raise self._value File "/usr/lib/python3.4/multiprocessing/pool.py", line 119, in worker result = (True, func(*args, **kwds)) File "/usr/local/lib/python3.4/dist-packages/keras/utils/data_utils.py", line 379, in get_index return ds[i] File "/usr/local/lib/python3.4/dist-packages/keras/preprocessing/image.py", line 759, in getitem return self._get_batches_of_transformed_samples(index_array) File "/usr/local/lib/python3.4/dist-packages/keras/preprocessing/image.py", line 805, in _get_batches_of_transformed_samples raise NotImplementedError NotImplementedError
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/s405/pengcheng/project/Keras-FCN/train.py", line 231, in
label_suffix=label_suffix, ignore_label=ignore_label, label_cval=label_cval)
File "/home/s405/pengcheng/project/Keras-FCN/train.py", line 163, in train
class_weight=class_weight
File "/usr/local/lib/python3.4/dist-packages/keras/legacy/interfaces.py", line 87, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/keras/engine/training.py", line 2046, in fit_generator
generator_output = next(output_generator)
File "/usr/local/lib/python3.4/dist-packages/keras/utils/data_utils.py", line 518, in get
raise StopIteration(e)
StopIteration
I don't know how to fix this problem, can you give me some suggestions?