Python 在tflearn异常中:Feed dict请求名为';目标';但目前还不知道存在这样的变量

Python 在tflearn异常中:Feed dict请求名为';目标';但目前还不知道存在这样的变量,python,tensorflow,conv-neural-network,tflearn,Python,Tensorflow,Conv Neural Network,Tflearn,iam使用tflearn构建CNN,但iam面临以下错误: Traceback (most recent call last): File "/home/hassan/JPG-PNG-to-MNIST-NN-Format/CNN_network.py", line 55, in <module> ({'input' :test_images}, {'targets' :test_labels}), snapshot_step = 500, File "/hom

iam使用tflearn构建CNN,但iam面临以下错误:

    Traceback (most recent call last):
  File "/home/hassan/JPG-PNG-to-MNIST-NN-Format/CNN_network.py", line 55, in <module>
    ({'input' :test_images}, {'targets' :test_labels}), snapshot_step = 500,
  File "/home/hassan/anaconda3/envs/object-detection/lib/python3.7/site-packages/tflearn/models/dnn.py", line 192, in fit
    self.targets)
  File "/home/hassan/anaconda3/envs/object-detection/lib/python3.7/site-packages/tflearn/utils.py", line 331, in feed_dict_builder
    "such variable is known to exist" % key)
Exception: Feed dict asks for variable named 'targets' but no such variable is known to exist

Process finished with exit code 1

load_dataset是将数据集加载到变量中的函数,因此请尝试直接传递参数,而不是在字典数据结构中传递参数

因此,代码不是:

model.fit({'input': train_images}, {'target': train_labels}, n_epoch=30,
      validation_set=({'input': test_images}, {'target': test_labels}),
      snapshot_step=500, show_metric=True, run_id='characterOCR')
它将是:

model.fit(train_images, train_labels, n_epoch=30,
      validation_set=(test_images, test_labels),
      snapshot_step=500, show_metric=True, run_id='characterOCR')
我也有同样的问题,这对我来说似乎是可行的。请在此处查看描述解决方案的错误报告:

干杯

model.fit(train_images, train_labels, n_epoch=30,
      validation_set=(test_images, test_labels),
      snapshot_step=500, show_metric=True, run_id='characterOCR')