【发布时间】:2019-06-11 15:32:16
【问题描述】:
我正在尝试在 Spyder 上使用 fit_generator() 来训练神经网络(我想训练它来整理数字图像),但我总是遇到同样的问题。当我调用该函数时,我得到的第一个结果是:
然后:
基本上,我不明白这是怎么回事。我将附上代码段。
X_train, X_val, y_train, y_val = train_test_split(X_train, y_train, test_size=0.10, random_state=42)
batches = gen.flow(X_train, y_train, batch_size=64) # batches.n = 37800
val_batches = gen.flow(X_val, y_val, batch_size=64) # val_batches.n = 4200
history=model.fit_generator(generator=batches, steps_per_epoch=batches.n,
epochs=3, validation_data=val_batches,
validation_steps=val_batches.n)
有人可以帮我吗?
提前致谢。
【问题讨论】:
-
(这里是 Spyder 维护者)你在使用 Anaconda 吗?
-
是的,我正在使用 Anaconda
-
你是如何安装 Tensorflow 的?
-
我使用的是 python 3.6,我不记得 Tensorflow 是如何安装的。我想我使用了这个命令“conda install -c conda-forge tensorflow”
-
这可能是问题所在。请创建一个新的 conda 环境并使用
conda install tensorflow安装 tensorflow。
标签: python keras neural-network kernel spyder