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

When train the model with running main.py, i triggers a TypeError #38

Open
Geek-Peng opened this issue Apr 9, 2018 · 1 comment
Open

Comments

@Geek-Peng
Copy link

Error message is as follow:
File "F:/Implementation-CVPR2015-CNN-for-ReID-master/CUHK03/main.py", line 109, in
main('F:/Implementation-CVPR2015-CNN-for-ReID-master/CUHK03/cuhk-03.h5')

File "F:/Implementation-CVPR2015-CNN-for-ReID-master/CUHK03/main.py", line 21, in main
train(model, dataset_path)

File "F:/Implementation-CVPR2015-CNN-for-ReID-master/CUHK03/main.py", line 49, in train
model.fit_generator(Data_Generator.flow(f,flag = flag_train),
one_epoch,epoch_num,
validation_data=Data_Generator.flow(f,train_or_validation=which_val_data,flag=flag_val),
nb_val_samples=nb_val_samples)

File "E:\Anaconda\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper
return func(*args, **kwargs)

File "E:\Anaconda\lib\site-packages\keras\engine\training.py", line 2079, in fit_generator
do_validation = bool(validation_data)

TypeError: 'float' object cannot be interpreted as an integer

python version: 3.5.2
keras version:2.1.5
tensorflow-gpu:1.7
OS:windows 10

It seems that bool() need a integer argument,but 'validation_data' is an object of class 'NumpyArrayIterator_for_CUHK03 '. I don't know how to deal with it.Thanks for your help.
@Ning-Ding

@abhigoku10
Copy link

@Geek-Peng you have to use keras version 2.0.0 since the numpy structure in keras version >2 is different

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