【问题标题】:InvalidArgumentError while using TensorBoard on a TensorFlow Hub Model在 TensorFlow Hub 模型上使用 TensorBoard 时出现 InvalidArgumentError
【发布时间】:2020-12-08 11:49:39
【问题描述】:

所以我使用this link 来了解 BERT 模型以及如何从 Tensorflow Hub 导入模型。

原码(Colab):

print(f'Training model with {tfhub_handle_encoder}')
history = classifier_model.fit(x=train_ds,
                               validation_data=val_ds,
                               epochs=epochs)

现在我尝试将 TensorBoard 添加到 Model.fit() 函数中,但在 12 帧后出现此错误。

/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
     58     ctx.ensure_initialized()
     59     tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
---> 60                                         inputs, attrs, num_outputs)
     61   except core._NotOkStatusException as e:
     62     if name is not None:

InvalidArgumentError: Value for attr 'T' of bool is not in the list of allowed values: float, double, int32, uint8, int16, int8, int64, bfloat16, uint16, half, uint32, uint64
    ; NodeDef: {{node WriteHistogramSummary}}; Op<name=WriteHistogramSummary; signature=writer:resource, step:int64, tag:string, values:T -> ; attr=T:type,default=DT_FLOAT,allowed=[DT_FLOAT, DT_DOUBLE, DT_INT32, DT_UINT8, DT_INT16, DT_INT8, DT_INT64, DT_BFLOAT16, DT_UINT16, DT_HALF, DT_UINT32, DT_UINT64]; is_stateful=true> [Op:WriteHistogramSummary]

我的代码(Colab):

%load_ext tensorboard
!rm -rf ./logs/
log_dir = "logs/fit/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
tensorboard_callback = tf.keras.callbacks.TensorBoard(log_dir=log_dir, histogram_freq=1)
print(f'Training model with {tfhub_handle_encoder}')
history = classifier_model.fit(x=train_ds,
                               validation_data=val_ds,
                               epochs=epochs,
                               callbacks=[tensorboard_callback])
%tensorboard --logdir logs/fit

here 发布了一个类似的问题,但没有得到回复。

请帮忙!

编辑 1:错误的屏幕截图

请提出任何修改建议。

【问题讨论】:

    标签: python tensorflow nlp tensorboard bert-language-model


    【解决方案1】:

    GitHub 上的 TensorFlow 存储库中有一个未解决的问题。 issue #43200

    正在提出解决方案,但我不知道它是否已在核心框架中实施(因此问题尚未解决)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-08-14
      • 2019-12-05
      • 1970-01-01
      • 2018-09-27
      • 2020-01-26
      • 2021-04-09
      • 2019-03-27
      相关资源
      最近更新 更多