小编nik*_*kko的帖子

错误节点:“binary_crossentropy/Cast”在训练模型时不支持将字符串转换为浮点数

我想训练我的数据,我已经将我的数据与 word2vec 预训练模型进行字符串连接https://dl.fbaipublicfiles.com/fasttext/vectors-crawl/cc.id.300.vec.gz,并成功创建模型,但是当我想训练数据集时,我收到了这样的错误

UnimplementedError                        Traceback (most recent call last)
<ipython-input-28-85ce60cd1ded> in <module>()
      1 history = model.fit(X_train, y_train, epochs=6,
      2                     validation_data=(X_test, y_test),
----> 3                     validation_steps=30)

1 frames
/usr/local/lib/python3.7/dist-packages/tensorflow/python/eager/execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
     53     ctx.ensure_initialized()
     54     tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
---> 55                                         inputs, attrs, num_outputs)
     56   except core._NotOkStatusException as e:
     57     if name is not None:

UnimplementedError: Graph execution error:

#skiping error

Node: 'binary_crossentropy/Cast'
Cast string to float is not supported
     [[{{node binary_crossentropy/Cast}}]] [Op:__inference_train_function_21541]
Run Code Online (Sandbox Code Playgroud)

代码 : …

python nlp machine-learning lstm tf.keras

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

标签 统计

lstm ×1

machine-learning ×1

nlp ×1

python ×1

tf.keras ×1