-1
je ne suis pas en mesure de charger un ensemble de données d'image en python utilisant tflearn il me montre une erreur ...pas en mesure de charger l'ensemble de données d'image en python utilisant tflearn
TypeError: image_preloader() got an unexpected keyword argument 'categorical_lables'
Voici le code ..
from __future__ import division, print_function, absolute_import
import tflearn
import tensorflow as tf
from tflearn.data_utils import shuffle
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.conv import conv_2d, max_pool_2d
from tflearn.layers.estimator import regression
from tflearn.data_preprocessing import ImagePreprocessing
from tflearn.data_augmentation import ImageAugmentation
import pickle
dataset_file = 'data.txt'
from tflearn.data_utils import image_preloader
X,Y=image_preloader(dataset_file, image_shape=(100,100),mode=file,categorical_lables=True,normalize=True)
img_prep = ImagePreprocessing()
img_prep.add_featurewise_zero_center()
img_prep.add_featurewise_stdnorm()
network = input_data(shape=[None, 32, 32, 3],
data_preprocessing=img_prep,
data_augmentation=img_aug)
network = conv_2d(network, 32, 3, activation='relu')
network = max_pool_2d(network, 2)
network = conv_2d(network, 64, 3, activation='relu')
network = conv_2d(network, 64, 3, activation='relu')
network = max_pool_2d(network, 2)
network = fully_connected(network, 512, activation='relu')
network = dropout(network, 0.5)
network = fully_connected(network, 2, activation='softmax')
network = regression(network, optimizer='adam',
loss='categorical_crossentropy',
learning_rate=0.001)
model = tflearn.DNN(network, tensorboard_verbose=0, checkpoint_path='bird-classifier.tfl.ckpt')
model.fit(X, Y, n_epoch=100, shuffle=True, validation_set=(X_test, Y_test),
show_metric=True, batch_size=96,
snapshot_epoch=True,
run_id='bird-classifier')
et data.txt fichier constains /chemin/vers/image classe
exemple img1.jpeg 0 img2.jpeg 1 . . . . . . .
je l'ai vérifié .... aucune erreur dans l'orthographe .. –
Ensuite, si cela ne fonctionne toujours pas, vous devriez obtenir une erreur différente maintenant. Dans le code que vous avez posté, vous passez 'categorical_lables = True' à' image_preloader' quand il attend 'categorical_labels', ce qui provoque l'erreur inattendue du mot clé. – cullywest