tensorflow 一些参数错误弹出在谷歌colab与CNN模型

voj3qocg  于 5个月前  发布在  其他
关注(0)|答案(1)|浏览(54)
history = model.fit(
    train_images,
    steps_per_epoch=len(train_images),
    validation_data=val_images,
    validation_steps=len(val_images),
    epochs=35,
    callbacks=[
        early_stopping,
        create_tensorboard_callback("training_logs",
                                    "grape_classification"),
        checkpoint_callback,
    ]
)

字符串
错误类型:

Saving TensorBoard log files to: training_logs/grape_classification/20231027-035427
Epoch 1/35
---------------------------------------------------------------------------
InvalidArgumentError                      Traceback (most recent call last)
<ipython-input-23-2278d8f60656> in <cell line: 22>()
     20 validation_steps = len(val_images)
     21 
---> 22 history = model.fit(
     23     train_images,
     24     steps_per_epoch=len(train_images),

1 frames
/usr/local/lib/python3.10/dist-packages/tensorflow/python/eager/execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
     58         for t in inputs
     59     ]
---> 60     tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
     61                                         inputs, attrs, num_outputs)
     62   except core._NotOkStatusException as e:

InvalidArgumentError: Graph execution error:

Detected at node categorical_crossentropy/softmax_cross_entropy_with_logits defined at (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main


请帮我解决这个问题,做了一些改变,但仍然不工作

ppcbkaq5

ppcbkaq51#

#i thought some issue oncreate_tensorboard_callback("training_logs","grape_classification")

create_tensorboard_callback(log_dir= "training_logs")\*so check this, and pass keywordArguments like

字符串

  • 参考:
tf.keras.callbacks.TensorBoard(
    log_dir='logs',
    histogram_freq=0,
    write_graph=True,
    write_images=False,
    write_steps_per_second=False,
    update_freq='epoch',
    profile_batch=0,
    embeddings_freq=0,
    embeddings_metadata=None,
    **kwargs
)

相关问题