分享

请教深度学习中的一个错误

本帖最后由 djqlyy2922 于 2023-4-26 14:25 编辑

书python深度学习第2版,8.2.4节中的一个例子,狗和猫图片训练的一个实例:在运行到以下代码是报错!刚接触,不知道怎么定位查找问题!提示说什么输入为空,输入不为空啊,图片都有啊!
callbacks = [keras.callbacks.ModelCheckpoint(filepath = "convnet_from_scratch.keras",                                             save_best_only = True,monitor="val_loss")]
history = model.fit(train_dataset,                    epochs=30,                    validation_data=validation_dataset,                    callbacks=callbacks)

Epoch 1/30WARNING:tensorflow:AutoGraph could not transform <function Model.make_train_function.<locals>.train_function at 0x0000000013876A68> and will run it as-is.Please report this to the TensorFlow team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full output.Cause: 'arguments' object has no attribute 'posonlyargs'To silence this warning, decorate the function with @tf.autograph.experimental.do_not_convertWARNING: AutoGraph could not transform <function Model.make_train_function.<locals>.train_function at 0x0000000013876A68> and will run it as-is.Please report this to the TensorFlow team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full output.Cause: 'arguments' object has no attribute 'posonlyargs'To silence this warning, decorate the function with @tf.autograph.experimental.do_not_convert46/63 [====================>.........] - ETA: 16s - loss: 0.8032 - accuracy: 0.4891


---------------------------------------------------------------------------InvalidArgumentError                      Traceback (most recent call last)C:\Users\ADMINI~1\AppData\Local\Temp/ipykernel_4604/3772824337.py in <module>      4                     epochs=30,      5                     validation_data=validation_dataset,----> 6                     callbacks=callbacks)D:\RGZN\Anaconda\lib\site-packages\keras\utils\traceback_utils.py in error_handler(*args, **kwargs)     65     except Exception as e:  # pylint: disable=broad-except     66       filtered_tb = _process_traceback_frames(e.__traceback__)---> 67raise e.with_traceback(filtered_tb) from None     68     finally:     69       del filtered_tbD:\RGZN\Anaconda\lib\site-packages\tensorflow\python\eager\execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)     57     ctx.ensure_initialized()     58     tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,---> 59                                         inputs, attrs, num_outputs)     60   except core._NotOkStatusException as e:     61     if name is not None:InvalidArgumentError:  Input is empty.         [[{{node decode_image/DecodeImage}}]]         [[IteratorGetNext]] [Op:__inference_train_function_1358]



已有(1)人评论

跳转到指定楼层
nettman 发表于 2023-4-27 20:20:26


1.png

人工智能时代,要利用好chatgpt.

我在这里帮你问了下。有更多问题,可以继续问他。不会使用工具,以后效率将会十分低下。
https://chat.aboutyun.com/
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条