-1

tflearn を使用して画像データセットを Python にロードできません。エラーが表示されます...

TypeError: image_preloader() got an unexpected keyword argument 'categorical_lables'

以下はコードです..

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')

および data.txt ファイルには /path/to/image クラスが含まれています

例 img1.jpeg 0 img2.jpeg 1 。. . . . . .

4

1 に答える 1

2

のスペルを確認してくださいcategorical_labels

于 2017-04-05T01:18:28.717 に答える