迁移学习预训练模型

问题描述 投票:0回答:1

我正在 Google Colab 上拟合迁移学习模型。但是,我遇到了带有代码的警告消息

Epoch 1/30
/usr/local/lib/python3.10/dist-packages/keras/src/trainers/data_adapters/py_dataset_adapter.py:121: 
UserWarning: Your `PyDataset` class should call `super().__init__(**kwargs)` in 
its constructor. `**kwargs` can include `workers`, `use_multiprocessing`, `max_queue_size`. 
Do not pass these arguments to `fit()`, as they will be ignored.
  self._warn_if_super_not_called()

在第一个纪元之后,我收到以下错误:

---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-23-962a870d4412> in <cell line: 16>()
     14 # fit the model
     15 # Run the cell. It will take some time to execute
---> 16 training_history = model_efficientnet.fit(
     17   training_set,
     18   validation_data=validate_set,

我已经成功地拟合了其他六个迁移学习模型,没有任何问题,并且它们的准确性令人满意。

如何解决这个问题?

我想获得训练准确性和验证准确性

python machine-learning keras deep-learning artificial-intelligence
1个回答
0
投票

尝试使用“super().init()”来正确初始化基类构造函数。该警告表示您应该使用 super().init(**kwargs) 调用基类构造函数。希望这对你有用。

© www.soinside.com 2019 - 2024. All rights reserved.