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 of "model.predict_generator" #3

Closed
ycjing opened this issue Apr 8, 2017 · 5 comments
Closed

Error of "model.predict_generator" #3

ycjing opened this issue Apr 8, 2017 · 5 comments

Comments

@ycjing
Copy link

ycjing commented Apr 8, 2017

Hi, thanks for the great code. It is great for a beginner of Keras, like me. But I found some errors when I run the code. In gap.py, the terminal reports that "AttributeError: 'DirectoryIterator' object has no attribute 'nb_sample'". I wonder if it is due to the different versions of keras and is there any solutions to this? Thanks ahead of time!

@ypwhs
Copy link
Owner

ypwhs commented Apr 8, 2017

我用的版本是 Keras 1.2.2,你可以用这个命令安装这个版本的Keras:

pip install keras==1.2.2

@ycjing
Copy link
Author

ycjing commented Apr 8, 2017

@ypwhs Thanks!

@ycjing ycjing closed this as completed Apr 8, 2017
@dysdsyd
Copy link

dysdsyd commented May 20, 2017

@ycjing, Replace nb_sample with samples.

@elitezhe
Copy link

@syeddanish41 Thanks for your reply. But I find that the train_generator.samples return value of 25000, that is number of total pictures.
However, we generate feature by batch, so predict_generator will run batch_size times more, this seems make the progress never end.

I tried replace nb_sample with samples//batch_size, it works.(but cannot generate all the 25000, since the batch size i chose is 16)

@leeguandong
Copy link

你好,我运行了下,出现了两个错误 1、OSError: [Errno 22] Invalid argument: 'train2\cat\cat.0.jpg' 2、TypeError: Error when checking : data should be a Numpy array, or list/dict of Numpy arrays. Found: None...
没法导出后h5文件??

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

5 participants