Ning-Ding / Implementation-CVPR2015-CNN-for-ReID

Implementation for CVPR 2015 Paper: "An Improved Deep Learning Architecture for Person Re-Identification".
MIT License
147 stars 71 forks source link

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

Open Geek-Peng opened 6 years ago

Geek-Peng commented 6 years ago

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 commented 6 years ago

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