小编Dan*_*ele的帖子

Keras:在使用 model.fit 时修复“IndexError:list index out of range”错误

我正在尝试构建一个带有多个可与 cifar-10 一起使用的 Conv2d 层的变分自动编码器。看起来没问题,但是当我运行培训时,我收到此错误:

Train on 50000 samples, validate on 10000 samples
  100/50000 [..............................] - ETA: 2:19

---------------------------------------------------------------------------

IndexError                                Traceback (most recent call last)

<ipython-input-8-a9198aa155a7> in <module>()
      3         epochs=1,
      4         batch_size=batch_size,
----> 5         validation_data=(x_test, None))

20 frames

/tensorflow-2.0.0-rc2/python3.6/tensorflow_core/python/keras/engine/training_eager.py in _model_loss(model, inputs, targets, output_loss_metrics, sample_weights, training)
    164 
    165         if hasattr(loss_fn, 'reduction'):
--> 166           per_sample_losses = loss_fn.call(targets[i], outs[i])
    167           weighted_losses = losses_utils.compute_weighted_loss(
    168               per_sample_losses,

IndexError: list index out of range
Run Code Online (Sandbox Code Playgroud)

我尝试重置内核,也尝试过 tensorflow 2.0 和 1.14.0,但没有任何变化。我是 keras 和 tf 的新手,所以我可能犯了一些错误。

这是我的 VAE …

python deep-learning keras tensorflow tf.keras

5
推荐指数
2
解决办法
1万
查看次数

标签 统计

deep-learning ×1

keras ×1

python ×1

tensorflow ×1

tf.keras ×1