aurora95 / Keras-FCN

Keras-tensorflow implementation of Fully Convolutional Networks for Semantic Segmentation(Unfinished)
MIT License
650 stars 268 forks source link

AttributeError: 'SegDirectoryIterator' object has no attribute 'next' #73

Open jiyeonBaek opened 6 years ago

jiyeonBaek commented 6 years ago

Hello I was running your code and I got a problem. I got that error during running of train.py

Exception in thread Thread-2: Traceback (most recent call last): File "C:\Users\Baek\Anaconda3\lib\threading.py", line 916, in _bootstrap_inner self.run() File "C:\Users\Baek\Anaconda3\lib\threading.py", line 864, in run self._target(*self._args, *self._kwargs) File "C:\Users\Baek\Anaconda3\lib\site-packages\keras\utils\data_utils.py", line 568, in data_generator_task generator_output = next(self._generator) File "C:\Users\Baek\Anaconda3\lib\site-packages\keras\preprocessing\image.py", line 737, in next return self.next(args, **kwargs) AttributeError: 'SegDirectoryIterator' object has no attribute 'next'

Epoch 1/4000 Traceback (most recent call last): File "train.py", line 226, in label_suffix=label_suffix, ignore_label=ignore_label, label_cval=label_cval) File "train.py", line 158, in train class_weight=class_weight File "C:\Users\Baek\Anaconda3\lib\site-packages\keras\legacy\interfaces.py", line 87, in wrapper return func(*args, **kwargs) File "C:\Users\Baek\Anaconda3\lib\site-packages\keras\engine\training.py", line 2011, in fit_generator generator_output = next(output_generator) StopIteration

I know python2 uses object.next(), and python3 uses object.next() or just use next(~~)

But I cannot see what is wrong in this code. I will look forward to your answer. Thank you.

cemsaz commented 6 years ago

@jiyeonBaek, see (https://github.com/aurora95/Keras-FCN/issues/68)

F951 commented 6 years ago

Hi, I had used the code from this repository a few months ago without a problem, and recently I changed the versions of CUDA, cudnn, tensorflow, etc... and started to have the problem you describe. Be sure you're using an environment with python 3.5, and give a look to the versions of tf and Keras you're using. The error dissapear, in my case, using CUDAv8.0, cudnn 6.0, TF-gpu 1.4.0 and Keras 2.1.2. Hope this helps!

fookingthg commented 5 years ago

Changing Keras to version 2.1.2 solved the issue for me.

daodaoawaker commented 5 years ago

@F951 Hello ! what's your OS on which you made it , Ubuntu or Windows ? Are others those as described above ?