tensorflow没有处理完的问题

这篇博客记录了在训练深度学习模型过程中遇到的警告和错误,包括TensorFlow关于序列的警告、资源变量操作的弃用警告,以及在训练和验证过程中精度和损失的记录。尽管存在警告,但模型在第50个epoch时达到了高精度,并在评估中取得了满分成绩。此外,还展示了模型保存后的文件问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

求解答。。。。

没有解决的错误

util.cc:329

resource_variable_ops.py:1817

2021-06-14 19:48:01.485854: W tensorflow/python/util/util.cc:329] Sets are not currently considered sequences, but this may change in the future, so consider avoiding using them.
WARNING:tensorflow:From D:\LenovoQMDownload\ana\lib\site-packages\tensorflow\python\ops\resource_variable_ops.py:1817: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
Traceback (most recent call last):
  File "train_liveness.py", line 116, in <module>
    plt.plot(np.arange(0, EPOCHS), H.history["acc"], label="train_acc")
KeyError: 'acc'

KeyError: ‘acc’、KeyError: ‘val_acc’

acc改为accuracy
val_acc改为val_accuracy

# plot the training loss and accuracy
plt.style.use("ggplot")
plt.figure()
plt.plot(np.arange(0, EPOCHS), H.history["loss"], label="train_loss")
plt.plot(np.arange(0, EPOCHS), H.history["val_loss"], label="val_loss")
plt.plot(np.arange(0, EPOCHS), H.history["accuracy"], label="train_acc")
plt.plot(np.arange(0, EPOCHS), H.history["val_accuracy"], label="val_accuracy")
plt.title("Training Loss and Accuracy on Dataset")
plt.xlabel("Epoch #")
plt.ylabel("Loss/Accuracy")
plt.legend(loc="lower left")
plt.savefig(args["plot"])

错误1 dso_loader.cc:44

I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll

错误2

liveness.model生成文件夹,打开就是个垃圾。
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

Epoch 50/50
52/52 [==============================] - 0s 9ms/step - loss: 0.2215 - accuracy: 0.9193 - val_loss: 0.0077 - val_accuracy: 1.0000
[INFO] evaluating network...
              precision    recall  f1-score   support

        fake       1.00      1.00      1.00        46
        real       1.00      1.00      1.00        94

    accuracy                           1.00       140
   macro avg       1.00      1.00      1.00       140
weighted avg       1.00      1.00      1.00       140

[INFO] serializing network to 'liveness.model'...
2021-06-14 20:08:46.713795: W tensorflow/python/util/util.cc:329] Sets are not currently considered sequences, but this may change in the future, so consider avoiding using them.
WARNING:tensorflow:From D:\LenovoQMDownload\ana\lib\site-packages\tensorflow\python\ops\resource_variable_ops.py:1817: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.

(base) C:\Users\lenovo\Desktop\liveness-detection-opencv>

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值