【发布时间】:2020-11-20 17:31:54
【问题描述】:
我已经尝试使用相同的给定代码在 mnist 数据集上使用 keras 训练和测试 CNN。现在我想在 emnist 数据集上尝试相同的代码,但它给出了以下错误:
我正在尝试以下代码
!pip 安装 emnist
import numpy as np
import emnist
from tensorflow import keras
train_images = emnist.train_images()
train_labels = emnist.train_labels()
print(train_images.shape)
print(train_labels.shape)
这是输出:
Error:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-2-812445794c0d> in <module>
5 # The first time you run this might be a bit slow, since the
6 # mnist package has to download and cache the data.
----> 7 train_images = emnist.train_images()
8 train_labels = emnist.train_labels()
9
AttributeError: module 'emnist' has no attribute 'train_images'
请帮忙
【问题讨论】:
-
您使用的TensorFlow版本是否与您关注的文章中提到的相同/?
-
我找不到文章中指定的 tensorflow 版本。我正在将其更新到最新版本。让我们看看它是否有效
-
你能链接问题中的emnist包吗?和/或文章?
-
我只是将 emnist 安装为 pip install emnist 这个查询运行良好。但错误是在如上所示的这一行之后它实际上是一个作业......不是文章
标签: python pandas tensorflow conv-neural-network